Exceptions need to be made shareable
Currently, active exceptions are passed between Monitors without checking that they are shareable - indeed, they're NOT shareable, and not thread-safe. This needs to be fixed.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Most likely I will make exceptions use Immutable - all contents must themselves be shareable and you won't be able to reassign attributes after __init__.
The __cause__, __context__, and __traceback__ attributes are set after the instance is created. I'll allow this, but only let them be set once - attempting to set the same attribute after it's already been set would raise an exception.
Python currently reuses an exception when it gets reraised, replacing the old traceback with a new one. I will always raise a new exception, passing it the previous exception's .args.
The contents of the traceback are themselves not thread-safe. Fixing that will be punted to some future debugging API work.