Skip to content

Commit

Permalink
Merge pull request #122 from Aiven-Open/alex-fix-race-condition-while…
Browse files Browse the repository at this point in the history
…-config-reload

Fix a potential issue with race condition when reloading a config
  • Loading branch information
rdunklau authored Apr 10, 2024
2 parents 7c5e53c + 704841d commit 5700ff3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pglookout/pglookout.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,12 @@ def _get_check_interval(self) -> float:
def main_loop(self):
while self.running:
if self.config_reload_pending:
self.load_config()
self.config_reload_pending = False
try:
self.load_config()
except:
self.config_reload_pending = True
raise
try:
self._apply_latest_config_version()
except Exception as ex: # pylint: disable=broad-except
Expand Down

0 comments on commit 5700ff3

Please sign in to comment.