Fixes a race in FormatterStepSerializationRoundtrip.HackClone.writeObject#2994
Merged
Conversation
Member
|
Excellent find @bric3, thanks very much. This will likely resolve a lot of futzy issues. Out of curiosity - did you solve this purely by hand, or did an agent play a role? I'd be curious to understand the workflow only because it's such a subtle issue. |
Contributor
Author
|
Finding the suspect code was somewhat easy enough to connect the dots. I followed the stack trace and by looking at the code I noticed the issue having the initilizer null was a a clear pattern for me. stackBut confirming and reproducing it was done by an agent. I also intervened a bit at the end to correct a few minor stuff in the "build.gradle fixture". |
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.
There's a race in
FormatterStepSerializationRoundtrip.HackClone.writeObjectwhen certain conditioin are met, this PR to fixes it by publishing an object.Previously,
HackCloneassigned itscleanedclone before populating the clone’s equality or roundtrip state. If another Gradle worker serialized the same clone during that window, the nestedFormatterStepSerializationRoundtrip.writeObjectguard could see an half-initializedcleanedand then fail.This now builds the
cleanedclone locally, initializes the requested state, and only then publishes it.Adds a Gradle regression intgeration test that exercises the task input fingerprinting. In a real project the issue was caused by a configuration like this:
And
target.The added integration test, mimick the issue in a more deterministic way, by using the primitives to create the steps.
After creating the PR, please add a commit that adds a bullet-point under the
[Unreleased]section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:If your change only affects a build plugin, and not the lib, then you only need to update the
plugin-foo/CHANGES.mdfor that plugin.If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update
CHANGES.mdfor both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.This makes it easier for the maintainers to quickly release your changes :)