Preserve distributed job context and expose grade 4 operational signals

This commit is contained in:
Artyom
2026-11-06 12:57:10 +03:00
parent 1a171d0d0f
commit 44d81fd80e
32 changed files with 1098 additions and 35 deletions
@@ -35,6 +35,7 @@ async def handle_job(
logger.warning("job.rejected", reason="message does not match jobs.schema.json")
await message.reject(requeue=False)
return
observer.active(1)
started = time.perf_counter()
try:
outcome = (await bus.execute(ProcessJob(job))).value
@@ -49,6 +50,8 @@ async def handle_job(
await asyncio.sleep(REQUEUE_DELAY_SECONDS)
await message.nack(requeue=True)
return
finally:
observer.active(-1)
observed(job, outcome, started, observer, logger)
await message.ack()