Phase 12.L.E.7.3 — fix: allow_reuse_address for python3 healthz Phase B re-bind
Summary
Root cause finally pinned. Previous J.L.E.7.1 / .7.2 fixes were correct in their own right but neither fixed the actual issue: TIME_WAIT port lingering blocks v2's python3 healthz from rebinding port 8080 after v1's systemctl stop.
Trace
- v1 service receives SIGTERM
- v1's trap kills python3 → port 8080 → TIME_WAIT (~60s on Linux)
- v2 service starts → spawns new python3 → tries to bind 8080
-
TCPServer.__init__raises "Address already in use" (allow_reuse_addressdefaults to False in stdlib) - python3 crashes silently (background
&swallows the error) - healthz never responds → .sh's curl loop times out → rollback
Fix
Subclass TCPServer with allow_reuse_address = True. Standard recipe for short-lived restart-friendly test servers.
Lesson
This is the kind of bug only real systemd + real port + real restart can surface. No mock would have caught it. The J.E.3.1 Windows pattern continues — high-fidelity E2E earns its keep.