Commit dac332e
committed
distsql: emit cancellation error in MoveToDraining
Previously if the context used to run a processor was canceled, most of
the time the emitted error would be that context cancellation, however
this depended on the exact implementation of each processor and the code
it called reliably returning the context cancelled error exactly in this
case. In at least some places, this is not reliably done.
This changes DistSQL's base processor to ensure that if the context it
is using to run a processor is canceled, the error emitted in MoveToDraining
is always the context cancellation error, by overriding the error passed
with the context error in MoveToDraining if the former is set.
This ensures callers inspecting errors to determine if they are due to
cancellation can always rely a cancelled flow's emitted error being
a cancellation error.
Fixes #156337.
Release note: none.
Epic: none.1 parent 5134873 commit dac332e
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
| |||
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
550 | 564 | | |
551 | 565 | | |
552 | 566 | | |
| |||
0 commit comments