Skip to content

Commit 6cef95d

Browse files
committed
mgr/cephadm: clean up deploy/removal queue if apply throws Exception
If we don't, the next time _apply_all_services gets called, assuming it decides the same daemons should be added/removed it will end up trying to deploy/remove double the daemons it should Signed-off-by: Adam King <[email protected]> (cherry picked from commit 328fa3c) Resolves: rhbz#2372821
1 parent 1c89773 commit 6cef95d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pybind/mgr/cephadm/serve.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,14 @@ def serve(self) -> None:
117117
if self.mgr.migration.is_migration_ongoing():
118118
continue
119119

120-
if self._apply_all_services():
121-
continue # did something, refresh
120+
try:
121+
if self._apply_all_services():
122+
continue # did something, refresh
123+
except Exception:
124+
# guarantee we don't leave things in the deploy/removal queue
125+
self.mgr.daemon_deploy_queue.clear_queued_daemons()
126+
self.mgr.daemon_removal_queue.clear_queued_daemons()
127+
raise
122128

123129
self._check_daemons()
124130

0 commit comments

Comments
 (0)