feat: implement context propagation - #153
Conversation
38c6f62 to
3f0ce78
Compare
| try: | ||
| yield | ||
| finally: | ||
| try: | ||
| stack.close() | ||
| except Exception as exc: | ||
| raise ContextPropagationError("Context propagation cleanup failed") from exc |
There was a problem hiding this comment.
💡 Edge Case: Cleanup error in propagation scope masks in-flight exception
In context_propagation_scope, the finally block re-raises a ContextPropagationError from stack.close(). When the wrapped workflow/activity body raises a business exception (or ContinueAsNewError) and a propagator's extract context-manager exit also fails during unwind, the ContextPropagationError replaces the original exception as the propagated error (the original is only preserved via __context__). This can hide the true cause of a workflow/activity failure and make debugging harder. Consider suppressing or logging the cleanup error when an exception is already in flight, so the original error still surfaces.
Was this helpful? React with 👍 / 👎
Signed-off-by: Tim Li <ltim@uber.com>
3f0ce78 to
532ad27
Compare
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsImplements comprehensive context propagation across clients, workers, and workflows using a new 💡 Edge Case: Cleanup error in propagation scope masks in-flight exception📄 cadence/_internal/context_propagation.py:111-117 In 🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
What changed?
Why?
How did you test it?
Potential risks
Release notes
Documentation Changes