Skip to content
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

fix(batch): Stop polling after data stream returns None #4371

Merged
merged 2 commits into from
Aug 2, 2022

Conversation

liurenjie1024
Copy link
Contributor

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

Task execution should stop polling data stream after returning None.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

Closes #4132

@github-actions github-actions bot added the type/fix Bug fix label Aug 2, 2022
Copy link
Contributor

@BowenXiao1999 BowenXiao1999 left a comment

Choose a reason for hiding this comment

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

Also notice this problem

src/batch/src/task/task_execution.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #4371 (68c8662) into main (368823f) will decrease coverage by 0.01%.
The diff coverage is 20.83%.

@@            Coverage Diff             @@
##             main    #4371      +/-   ##
==========================================
- Coverage   74.47%   74.46%   -0.02%     
==========================================
  Files         846      846              
  Lines      123168   123188      +20     
==========================================
+ Hits        91726    91727       +1     
- Misses      31442    31461      +19     
Flag Coverage Δ
rust 74.46% <20.83%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/batch/src/task/broadcast_channel.rs 0.00% <0.00%> (ø)
src/batch/src/task/channel.rs 63.63% <0.00%> (-3.04%) ⬇️
src/batch/src/task/hash_shuffle_channel.rs 0.00% <0.00%> (ø)
src/batch/src/task/fifo_channel.rs 86.11% <25.00%> (-7.83%) ⬇️
src/batch/src/task/task_execution.rs 53.27% <44.44%> (-0.99%) ⬇️
src/meta/src/manager/id.rs 94.56% <0.00%> (-0.55%) ⬇️
src/common/src/types/ordered_float.rs 29.10% <0.00%> (+0.19%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Comment on lines +329 to +331
// This is possible since when we have limit executor in parent
// stage, it may early stop receiving data from downstream, which
// leads to close of channel.
Copy link
Contributor

Choose a reason for hiding this comment

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

I doubt whether this statement is still valid. Seems like I can directly unwrap...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's valid. LimitExecutor or TopNExecutor still may early stop receiver.

@mergify mergify bot merged commit 074daaf into main Aug 2, 2022
@mergify mergify bot deleted the renjie/fix_send_error2 branch August 2, 2022 08:47
x => {
return Err(InternalError(format!("Failed to send data: {:?}", x)))?;
if let Some(data_chunk) = res {
if let Err(e) = sender.send(Some(data_chunk?)).await {
Copy link
Contributor

Choose a reason for hiding this comment

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

If the chunk is Some, I think unwrap on send error is make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is possible with LimitExecutor

nasnoisaac pushed a commit to nasnoisaac/risingwave that referenced this pull request Aug 9, 2022
…labs#4371)

* fix(batch): Stop polling after data stream returns None

* Fix comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: batch query with limit: internal error: channel closed
3 participants