Commit 9a13f8e
committed
sql: add safety gates for pausable portal cleanup and flow invalidation
Epic: None
Informs: cockroachlabs/support#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: None1 parent d3e894c commit 9a13f8e
2 files changed
+15
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2598 | 2598 | | |
2599 | 2599 | | |
2600 | 2600 | | |
2601 | | - | |
2602 | | - | |
2603 | 2601 | | |
2604 | 2602 | | |
2605 | 2603 | | |
| |||
2611 | 2609 | | |
2612 | 2610 | | |
2613 | 2611 | | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
2614 | 2623 | | |
2615 | 2624 | | |
2616 | | - | |
2617 | | - | |
2618 | | - | |
2619 | | - | |
2620 | | - | |
2621 | | - | |
2622 | | - | |
2623 | | - | |
2624 | | - | |
2625 | | - | |
2626 | 2625 | | |
2627 | 2626 | | |
2628 | 2627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1979 | 1979 | | |
1980 | 1980 | | |
1981 | 1981 | | |
1982 | | - | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
1983 | 1986 | | |
1984 | 1987 | | |
1985 | 1988 | | |
| |||
0 commit comments