Repository navigation
Fix LocalExecutor crash on non-picklable exceptions (e.g. httpx.HTTPStatusError) - #64485
Pranaykarvi wants to merge 3 commits into
Conversation
|
@Pranaykarvi please explain how you verified the issue present only in LocalExecutor? |
|
@eladkal , Thanks for raising this! From what I observed, this issue is tied specifically to Other executors (like KubernetesExecutor or CeleryExecutor) don’t rely on multiprocessing queues in the same way they use external systems (like the K8s API, message brokers, or the metadata DB) to communicate task results, so they don’t run into this problem. I reproduced the issue using |
|
Wasn't this already fixed in #48517 ! |
There was a problem hiding this comment.
Pull request overview
Fixes a LocalExecutor failure mode where worker subprocess exceptions may be unpicklable (e.g. httpx.HTTPStatusError), which can crash the scheduler when the exception object is sent back over a multiprocessing.Queue.
Changes:
- Import
tracebackand wrap worker exceptions into a pickle-safeExceptioncontaining type/message + formatted traceback. - Apply the same wrapping behavior to both task execution and callback execution failure paths.
|
@kaxil @eladkal All 6 Copilot review comments have been addressed:
Ready for re-review! |
Did you check this? I am trying to figure out what changed between then and now |
|
@kaxil @eladkal Thanks for the pointer to #48517 — you're right, I've verified that #48517 was merged into main on March 29, 2025 Closing this PR as a duplicate. Apologies for the noise! |
Closes #64476
When LocalExecutor runs a task in a subprocess, exceptions are passed back via multiprocessing.Queue using pickle. Some exceptions like httpx.HTTPStatusError are not pickle-safe, causing:
This crashes the scheduler loop and takes down the entire scheduler pod.
Root Cause
Raw exception objects were placed directly onto the result queue:
Fix
Wrap the exception in a plain Exception before queuing:
Applied to both ExecuteTask and ExecuteCallback branches.
Impact