fix: Revert "Use thread pools (#601)" #665
Merged
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 reverts commit 6619f14 (and I added comments to avoid someone using a thread pool again in the future).
It seems that when a thread pool is used it allows a thread to try and
unlock()
a lock that it did notlock()
, whichReentrantLock
does not allow - "If the current thread is not the holder of this lock then IllegalMonitorStateException is thrown."I can't reproduce #660 myself, but based on the description and stack trace in #660 it makes sense that this change could cause this issue in certain multi-threaded states.
It would be good to get a release out in the near term with this fix to see if it does indeed resolve the issue.
Fixes #660