fix(otlp-http): reset requests session after fork by dshivashankar1994 · Pull Request #4995 · open-telemetry/opentelemetry-python
The changes looks good to me, before approving I would like to reproduce with a plain gunicorn web app (or similar) instead of the provided hand crafted one.
This didn't occur as part of Gunicorn or web apps but a generic fork‑and‑daemon execution model that is common in batch and job‑runner systems. The reproducer I shared is intentionally minimal to isolate the fork‑safety problem itself, independent of any specific framework.
Our workloads involve short‑lived parent processes that fork and immediately daemonize. As part of daemon hygiene, the child process explicitly closes all inherited file descriptors shortly after fork. This is a key trigger for the issue. The failure manifests specifically when resources initialized in the parent (HTTP sessions, background threads, and their shutdown finalizers) are inherited by the child and later cleaned up after OS‑level FD closure.