-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Dev] Fix an issue causing ExecuteTask to do much more work than intended #14034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dev] Fix an issue causing ExecuteTask to do much more work than intended #14034
Conversation
…shInternal knows to return early, respecting the 'max_chunks' set by PipelineExecutor::Execute()
This is definitely out of my depth and I'm not confident all cases are considered or the necessary state in the PipelineExecutor is preserved to support pausing this process. The original problem was that ExecutePushInternal would only return when the |
|
I fixed this by detecting that Outside of if (remaining_sink_chunk) {
return PipelineExecuteResult::INTERRUPTED;
} else {
return PipelineExecuteResult::NOT_FINISHED;
} By not setting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This looks great. I just want to add a few assertions:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! LGTM now
Thanks! |
This PR makes
ExecutePushInternal
respect themax_chunks
set in the call toPipelineExecutor::Execute(idx_t max_chunks)
When running DuckDB inside an environment where the control over received signals (like SIGINT) is not instant (like Python or Postgres), we rely on ExecuteTask to return after doing a small amount of processing work.
In the DuckDB CLI this problem was not apparent because SIGINT is handled and
Interrupt()
is called instantly, which is respected by the execution.This problem only appeared because the
interrupt
flag could not be set as the application was first waiting for ExecuteTask to return.