Stop crashing when panic occurs in thread pool - #4593
Merged
Conversation
Member
|
@Kerollmops if you want to make it available for v1.8, you should not merge into |
Kerollmops
force-pushed
the
rayon-catch-panics
branch
from
April 22, 2024 14:02
d2455a5 to
d5cfc43
Compare
Kerollmops
force-pushed
the
rayon-catch-panics
branch
from
April 22, 2024 14:02
d5cfc43 to
8f15c3e
Compare
Kerollmops
force-pushed
the
rayon-catch-panics
branch
from
April 22, 2024 14:26
8f15c3e to
e75c882
Compare
Kerollmops
force-pushed
the
rayon-catch-panics
branch
from
April 22, 2024 16:09
e75c882 to
b3173d0
Compare
Kerollmops
marked this pull request as ready for review
April 24, 2024 14:42
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #4362 by introducing a new boolean to catch panics in the rayon thread pool. The boolean is read after performing the operations in rayon, and the indexation process is stopped. This first version doesn't expose the panic message but marks the task as failed.
The current implementation exposes a
ThreadPoolNoAbortwrapper. Therayon::ThreadPoolhas been wrapped to check that nothing went wrong after running theThreadPool::installfunction. An atomic boolean and somestore/loadlogic make the system work efficiently.Before, Meilisearch was completely crashing...
Now, it handles the panics correctly and marks the task as failed.