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 index worker depletion #1225

Merged
merged 3 commits into from
Dec 11, 2020
Merged

Fix index worker depletion #1225

merged 3 commits into from
Dec 11, 2020

Conversation

tobim
Copy link
Member

@tobim tobim commented Dec 10, 2020

📔 Description

A bug that causes the removal of index workers in case of false positive candidate partitions is fixed here.

📝 Checklist

  • All user-facing changes have changelog entries.

@tobim tobim added the bug Incorrect behavior label Dec 10, 2020
@tobim tobim requested a review from a team December 10, 2020 20:57
Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

This needs a changelog entry, but other than that you're good to go. I actually noticed this while working on #1211 as well—and please let this be the last PR we merge before that one.

(If you want to do me a favor, wait until we merged #1211)

@tobim
Copy link
Member Author

tobim commented Dec 11, 2020

@dominiklohmann I added a second change that I thought makes sense. Please have another look.

Copy link
Member

@dominiklohmann dominiklohmann left a comment

Choose a reason for hiding this comment

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

I really like this additional change, just two nits. I did not verify this to work locally.

await_evaluation_maps(
self, iter->second.expression, actors,
[=](caf::expected<pending_query_map> maybe_pqm) {
auto& st = self->state;
auto drop = [&] {
self->state.idle_workers.emplace_back(std::move(*worker));
Copy link
Member

Choose a reason for hiding this comment

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

I think we should capture worker = std::move(*worker) in the lambda that we pass to await_evaluation_maps. This code does not need to know about the optional wrapping.

libvast/src/system/index.cpp Show resolved Hide resolved
@tobim tobim force-pushed the topic/avoid-worker-depletion branch from 87bb4fa to eb5a16d Compare December 11, 2020 17:39
@tobim tobim merged commit 16e7a38 into master Dec 11, 2020
@tobim tobim deleted the topic/avoid-worker-depletion branch December 11, 2020 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants