MCPcopy
hub / github.com/benoitc/gunicorn / _worker_monitor

Method _worker_monitor

gunicorn/dirty/arbiter.py:383–396  ·  view source on GitHub ↗

Periodically check worker health and manage pool.

(self)

Source from the content-addressed store, hash-verified

381 await self.stop()
382
383 async def _worker_monitor(self):
384 """Periodically check worker health and manage pool."""
385 while self.alive:
386 await asyncio.sleep(1.0)
387
388 # Check if parent (main arbiter) died unexpectedly
389 if os.getppid() != self.ppid:
390 self.log.warning("Parent changed, shutting down dirty arbiter")
391 self.alive = False
392 self._shutdown()
393 return
394
395 await self.murder_workers()
396 await self.manage_workers()
397
398 async def _handle_sigchld(self):
399 """Handle SIGCHLD - reap dead workers."""

Callers 3

_run_asyncMethod · 0.95

Calls 4

_shutdownMethod · 0.95
murder_workersMethod · 0.95
manage_workersMethod · 0.95
warningMethod · 0.45