You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
155669: sql: add safety gates for pausable portal cleanup and flow invalidation r=ZhouXing19 a=ZhouXing19
Informs: https://github.com/cockroachlabs/support/issues/3463
When a pausable portal encounters an error during execution, two issues can lead to panics on subsequent resume attempts:
1. The underlying FlowBase gets reset to nil during cleanup, but the portal's flow reference remains non-nil, causing hasFlowForPausablePortal() to incorrectly return true.
2. Errored portals are not removed from the portal map because deletion only occurs when execStmt() returns a non-nil fsm.Event.
This change adds two defensive checks:
- Nil the whole flow object hanging off the `portalInfo` while cleaning up the flow.
- Ensure errored portals are properly cleaned up regardless of event state
These gates prevent nil pointer dereferences when resuming portals that have been partially cleaned up due to errors.
Release note: None
Co-authored-by: ZhouXing19 <zhouxing@uchicago.edu>
0 commit comments