Skip to content

Commit 0767e81

Browse files
committed
docs(common): state the ExecutionJoin contract on the variant itself
The variant said a `JoinError` "can't occur for unjoined tasks, such as execution shutdown". That is about a handle nobody awaits, but it reads as ruling out the shutdown-cancelled join this variant now carries. State the contract instead: only a joined task reports a `JoinError`, a cancelled one lands here with the `JoinError` reachable as the source, and a panicking one goes to `from_join_error`'s resume path.
1 parent 9f47eeb commit 0767e81

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

datafusion/common/src/error.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,15 @@ pub enum DataFusionError {
132132
Execution(String),
133133
/// [`JoinError`] during execution of the query.
134134
///
135-
/// This error can't occur for unjoined tasks, such as execution shutdown.
135+
/// Only a task that is actually joined can report a [`JoinError`], so a task
136+
/// that is spawned and never awaited never reaches this variant. A joined
137+
/// task that was **cancelled** does: it was aborted, or the runtime it was
138+
/// spawned on shut down while it was still queued. The `JoinError` stays
139+
/// reachable as the error's source so a caller can still ask
140+
/// [`JoinError::is_cancelled`].
141+
///
142+
/// Construct this with [`DataFusionError::from_join_error`], which reports a
143+
/// **panicking** task by resuming its panic rather than returning it here.
136144
ExecutionJoin(Box<JoinError>),
137145
/// Error when resources (such as memory of scratch disk space) are exhausted.
138146
///

0 commit comments

Comments
 (0)