Comment 10 for bug 1529810

Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Marian, service.start() itself is run in a green thread and if it fails with exception, the service will still be alive from the ServiceLauncher point of view, so the launcher.wait() call will block, but nova-compute will not be able to do anything useful.

IMO, we need to fail (exit with some error code) early, if service.start() fails. The problem is that it's OK now for the start() call to end successfully in a thread - its task is to set up an RPC server and do other service initialisation steps - so this thread does not represent a running service and ends early on success.

Currently, I don't see a clean way to fail early with existing oslo.service API. What I was able to achieve is to call service.stop() immediately after service.start() call fails, which allows us to exit in service.wait(), although we still exit with a success error code (i.e. 0), not a failure one.