Fix Bdv too frequent navigation deadlock#372
Merged
tinevez merged 1 commit intoSep 8, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
A workaround to prevent excessive navigation requests to the Big Data Viewer by enforcing a minimum delay between actions, reducing the chance of deadlock.
- Introduces
lastNavigationTimeand a constantANIMATION_DURATIONto throttle rapid successive navigations. - Applies throttle checks in both
navigateToVertexandnavigateToEdge, and replaces hard-coded 300 ms durations with the new constant.
Comments suppressed due to low confidence (2)
src/main/java/org/mastodon/views/bdv/overlay/OverlayNavigation.java:129
- After allowing a navigation in
navigateToEdge,lastNavigationTimeis never updated. AddlastNavigationTime = now;immediately after the throttle check to correctly record the timestamp for subsequent calls.
panel.setTransformAnimator( animator );
src/main/java/org/mastodon/views/bdv/overlay/OverlayNavigation.java:51
- [nitpick] Consider renaming
ANIMATION_DURATIONto something likeNAVIGATION_THROTTLE_MSorANIMATION_DURATION_MSto clarify that it serves both as the animation duration and the cooldown interval.
private static final int ANIMATION_DURATION = 300;
a17c539 to
be02e00
Compare
Reasoning: Big Data Viewer may get stuck, if navigation requests are sent to it too frequently
be02e00 to
b5ef925
Compare
Contributor
|
This is an horrid bug and a sensitive part of the code. |
Contributor
|
I'll look at it during the celltrackathon |
Collaborator
Author
|
Just a reminder, since users seem to be running into this bug quite frequently, when heavily using mastodon.. |
Contributor
|
I will merge it now and make a new release. |
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 contains a strategy to avoid to frequent navigation requests to the Big Data Viewer, which cause Mastodon to get stuck in certain sitations.
It is not the actual bug fix (that probably needs to be done in Big Data Viewer), but a work around to avoid the Big Data Viewer to get into this bug.
Fixes #371
Improvements to navigation frequency control:
lastNavigationTimefield to track the timestamp of the last navigation request and prevent navigation requests that occur too frequently. This logic was implemented in bothnavigateToVertexandnavigateToEdgemethods. [1] [2] [3] [4]