Skip to content

Conversation

@LiaCastaneda
Copy link
Collaborator

assign_to_workers will panic when no healthy workers remain in the set.

@LiaCastaneda LiaCastaneda requested a review from NGA-TRAN July 14, 2025 13:01
Comment on lines +454 to +456
if workers.is_empty() {
return Err(anyhow!("No workers available to distribute stages").into());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I wonder why we have our own custom DDError wrapping other kinds of errors. I would have expected the vanilla DataFusionError from upstream to be sufficient for representing what we are doing.

Nothing related to this PR though.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have it for error kinds that can't happen in single node datafusion like WorkerCommunicationError

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabotechs regarding the error, my thinking was twofold. When returning an error to a client, those errors may be sourced by Arrow, DataFusion, Flight, or something else. I wanted to account for them all. Also when writing a function that returns a Result, if more than one type of error can occur in that function, its convenient (maybe its lazy?) to return a result type that has From traits for both of those errors so you can just use ? or into to propagate them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And can't all of that be accomplished with just pure DataFusionError? upstream has:

  • DataFusionError::ArrowError
  • DataFusionError::Execution
  • DataFusionError::IoError
  • DataFusionError::External(GenericError)

I imagine that for when this is open source, folks using datafusion-distributed could appreciate not needing to deal with additional error structures.

@LiaCastaneda LiaCastaneda merged commit 868cc77 into main Jul 14, 2025
3 checks passed
@gabotechs gabotechs deleted the lia/add-guard-to-avoid-panic branch August 4, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants