Repository navigation
Minimum Spanning Tree 1.0.1: don't throw when cancelled right as the run starts - #377
Merged
Merged
Conversation
cancel() delegated to an algorithm that is only created by execute(), so a cancel landing just after the run started threw a NullPointerException. Return false when there is no algorithm yet, and make the field volatile since it is set by the thread running the statistics and read when cancelling from another. Version 1.0.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Seen in the first CI run of the SPI contract tests on master-forge (#376): the cancellation test, which cancels from another thread right after the run starts, printed
MinimumSpanningTree.cancel()delegates tostAlgorithm, whichexecute()only creates when the run starts. A cancel that lands just before that (the user can click at any moment) threw. It's a race, so it shows up on slower machines.cancel()returnsfalsewhen there is no algorithm yet, instead of throwing.stAlgorithmisvolatile: it is written by the thread running the statistics and read when cancelling from another.Verified: the contract tests (gephi-plugins-tests 1.2.1-SNAPSHOT) pass on this module. The race doesn't fire on a fast local machine, so the fix itself is by inspection. Short-lived branch off
master-forge, 2 files.🤖 Generated with Claude Code