Skip to content

Phase 12.L.E.7.3 — fix: allow_reuse_address for python3 healthz Phase B re-bind

Placeholder ppxd requested to merge phase12.L.E.7.3-fix-port-reuse into main

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

  1. v1 service receives SIGTERM
  2. v1's trap kills python3 → port 8080 → TIME_WAIT (~60s on Linux)
  3. v2 service starts → spawns new python3 → tries to bind 8080
  4. TCPServer.__init__ raises "Address already in use" (allow_reuse_address defaults to False in stdlib)
  5. python3 crashes silently (background & swallows the error)
  6. 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.

🤖 Generated with Claude Code

Merge request reports

Loading