Infinite loop in DB load balancer retry logic
When doing a DB read, we rescue connection errors and retry:
When an instance has no secondaries configured, the LB host list is just HostList.new([PrimaryHost.new(self)])
and the primary can never be marked as offline: https://gitlab.com/gitlab-org/gitlab/blob/9599f8669a9395d5193be1b226b4c136f28f8e90/lib/gitlab/database/load_balancing/primary_host.rb#L51-57
So it will just continue to loop inside the while
. I think we should add a max retries here.
Follow-ups:
Edited by Thong Kuah