Skip to content

Commit 3183fa7

Browse files
StephanErbbrian-brazil
authored andcommitted
Provide robust Gunicorn config in multiprocess docs (prometheus#146)
We need to use the recently added Gunicorn `child_exited` callback in order to correctly clean up after a segfaulted or OOM-killed worker (for details, see benoitc/gunicorn#1394).
1 parent e5e73e5 commit 3183fa7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@ between Gunicorn runs (before startup is recommended).
421421

422422
Put the following in the config file:
423423
```python
424-
def worker_exit(server, worker):
425-
from prometheus_client import multiprocess
424+
from prometheus_client import multiprocess
425+
426+
def child_exit(server, worker):
426427
multiprocess.mark_process_dead(worker.pid)
427428
```
428429

0 commit comments

Comments
 (0)