Repository navigation
Destroy the views of the dynamic statistics and keep their base view - #3371
Merged
Merged
Conversation
A dynamic statistic created a view for every time window and never destroyed any, so each run left hundreds of live views that every later graph change had to update. It also read the visible view once and looked up its time index at each window: a filter destroying that view during the run made the next window throw, and the windows without time bounds read whatever was visible at the time. A filtered visible view is now copied under the write lock and read from that copy, a single window view is refilled for each window, and both are destroyed when the run ends, is cancelled or fails. The loop() javadoc now says the window view is only valid during the call. The graph model is also taken from the statistics model's workspace, as for static statistics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
3 of 8 tasks
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.
Description
Follow-up to the view lifetime work (gephi/graphstore#364, #3366, #3368, #3369). The dynamic statistics created a view for every time window and never destroyed it, and read the view to work on once, outside any lock.
StatisticsControllerImpl.executeDynamicand never destroyed, on any path, so a run left hundreds or thousands of live views behind (each one is updated on every change of the graph store, and GraphStore serializes views, so they were also written to saved projects).The view doesn't exist. The windows without time bounds read the current visible graph instead of that view, so after a filter change the two kinds of window were computed on different views.executeStaticdoes, so the run and its report could end up on different workspaces if the current workspace changed between the call and the start of the task.The visible view is now copied under the write lock into a private base view for the whole run (the main view is used as is). A single window view is created once, cleared and refilled for each window, and both views are destroyed in a
finally, after the read locks are released. A cancelled run still produces no report. Theloopjavadoc ofDynamicStatisticssays the window is only valid during the call, as it is now reused.Left out on purpose: the dynamic statistics write their series with
getGraphVisible().setAttribute(...), so when a filter replaces the visible view during the run they end up on different views.Checklist
Added tests?
StatisticsControllerImplTest, which destroys the filtered view during the first window and checks the next windows still read the filtered graph and that the window view is destroyed at the endAdded to documentation?
🤖 Generated with Claude Code