Merge "Allow clean service shutdown"

This commit is contained in:
Zuul
2025-06-06 23:07:42 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 2 deletions
+6 -2
View File
@@ -254,8 +254,12 @@ class Service(service.Service):
except Exception:
pass
db.service_update(context.get_admin_context(),
self.service_id, {'state': 'stopped'})
try:
db.service_update(context.get_admin_context(),
self.service_id, {'state': 'stopped'})
except exception.NotFound:
LOG.warning('Service stopped that has no database entry.')
if self.coordinator:
try:
coordination.LOCK_COORDINATOR.stop()
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed an issue where stopping a service would produce unhelpful database traceback if a
service entry didn't exist in the database for the service.