mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
The port allocator checks a port by binding a throwaway socket and closing it. When another thread spawns a subprocess at that moment, the child inherits a copy of the probe socket and keeps it until it execs. The copy has no SO_REUSEADDR, so a server that binds the port inside that window gets EADDRINUSE, which is how owned Redis and other harness servers occasionally fail to start while worker stacks start concurrently. On Linux a bound socket with SO_REUSEADDR does not stop another SO_REUSEADDR socket from binding and listening, so the probe now sets it there. Every harness server already binds with SO_REUSEADDR except the raw asgi listener and one occupying socket in the harness lifecycle test. Both set it now, because the probe can hand out ports that still have TIME_WAIT entries. macOS keeps the plain probe since BSD rules make a reuse probe both blocking and too permissive there. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_asgi.py | ||
| test_budget.py | ||
| test_client.py | ||
| test_database_relay.py | ||
| test_ordering.py | ||
| test_ports.py | ||
| test_process.py | ||
| test_routing.py | ||
| test_sdk_models.py | ||
| test_sharding.py | ||
| test_timing.py | ||
| test_translation.py | ||
| test_upstream.py | ||
| test_vertex.py | ||
| test_wire.py | ||
| test_workers.py | ||