fix: print exception to stderr on worker boot failure

When a worker fails to boot, the exception is now printed to stderr
(in addition to being logged), consistent with AppImportError handling.
This makes boot failures more visible to users.

Closes #2933
This commit is contained in:
Benoit Chesneau 2026-01-23 11:02:29 +01:00
parent 56abeaf105
commit 19d07bd4af

View File

@ -631,8 +631,10 @@ class Arbiter:
print("%s" % e, file=sys.stderr)
sys.stderr.flush()
sys.exit(self.APP_LOAD_ERROR)
except Exception:
except Exception as e:
self.log.exception("Exception in worker process")
print("%s" % e, file=sys.stderr)
sys.stderr.flush()
if not worker.booted:
sys.exit(self.WORKER_BOOT_ERROR)
sys.exit(-1)