Repository navigation
Do not enforce API processing timeout for parallel routing - #5114
Merged
t2gran merged 1 commit intoMay 22, 2023
Merged
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5114 +/- ##
=============================================
+ Coverage 64.75% 64.78% +0.03%
- Complexity 14123 14126 +3
=============================================
Files 1729 1728 -1
Lines 67369 67352 -17
Branches 7217 7215 -2
=============================================
+ Hits 43623 43633 +10
+ Misses 21324 21296 -28
- Partials 2422 2423 +1
☔ View full report in Codecov by Sentry. |
vpaturet
marked this pull request as ready for review
May 12, 2023 10:34
leonardehrenfried
approved these changes
May 15, 2023
leonardehrenfried
left a comment
Member
There was a problem hiding this comment.
I think this is an acceptable solution to a hard problem, so I approve. We should probably discuss this a bit during the meeting.
t2gran
approved these changes
May 22, 2023
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.
Summary
As reported in #5110, deadlocks can occur when the parallel routing feature is activated. This is a regression caused by #5047:
To propagate the timeout to other threads, the initial ForkJoinPool/CompletableFuture logic used in parallel routing has been replaced by a fixed thread pool, because ForkJoinPool does not propagate interruptions.
But the work-stealing properties of the ForkJoinPool are necessary to prevent deadlocks.
This PR reverts to a ForkJoinPool implementation for the parallel routing use case.
This change does not impact API processing timeout when parallel routing is not in use.
Note: The parallel heuristic feature does not trigger deadlocks since it uses its own thread pool and does not create sub-tasks.
OpenTripPlanner/src/main/java/org/opentripplanner/raptor/service/RangeRaptorDynamicSearch.java
Line 169 in 9eb6235
Issue
closes #5110Unit tests
✅
Documentation
Updated documentation