-
Notifications
You must be signed in to change notification settings - Fork 242
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: bulk ingester might skip listener requests #867
Conversation
💚 CLA has been signed |
Hello @fabriziofortino, thank you for the contribution and for highlighting this issue. I have tested your solution and while it helps mitigate the problem, when dealing with many requests there's still a possibility that the latest listener tasks are ignored because of the shutdown. I'll do more testing to figure out a way to handle this reliably, I'll let you know so that we can fix this PR and merge it. |
@fabriziofortino do you mind if I push on this branch? |
@l-trotta no problem, go ahead! |
@l-trotta I have also noticed this: in the if (scheduler != null && !isExternalScheduler) {
scheduler.shutdownNow();
} This will try to cancel the already submitted tasks. Shouldn't we call |
84a395b
to
324af0a
Compare
@fabriziofortino you're correct, however with the new changes it shouldn't be a problem either way, you can take a look :) |
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.
LGTM. Thanks for having caught this and the fix!
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
* fix: bulk ingester might skip lister requests * minor: fix style * always waiting for listener to be done before closing --------- Co-authored-by: Laura Trotta <laura.trotta@elastic.co> Co-authored-by: Laura Trotta <153528055+l-trotta@users.noreply.github.com>
Regression introduced in 8.15.0 appears to be fixed (elastic/elasticsearch-java#867). This partially reverts commit a345a15.
When BulkIngester uses the internal scheduler it might fail notifying the listener because the scheduler gets terminated before the
submit
is called. This happens because the close condition is signalled beforesubmit
is invoked. This PR fixes a regression introduced in #830