Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug in AttributeMap, which causes a ConcurrentModificationException… #5559

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

millems
Copy link
Contributor

@millems millems commented Sep 4, 2024

… when lazy properties depend on lazy properties that depend on any other property.

This is achieved by changing a compute into a get followed by a put.

This code path was not hit before the endpoint URL changes, which are forthcoming. Those changes also add a path that tests this change.

@millems millems requested a review from a team as a code owner September 4, 2024 22:11
@@ -319,6 +319,7 @@ private void internalPut(Key<?> key, Value<?> value) {
if (oldValue != null) {
dependencyGraph.valueUpdated(oldValue, value);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : unintentional ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

dependencyGraph.valueUpdated(v, newValue);
}
return newValue;
Value<?> currentValue = attributes.get(key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Is there any way in which we tested this ? If a unit test is difficult, A one-time runnable test that validates these changes would be helpful here. Lmk if its non-trivial to test / validate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new behavior is exercised in #5562. Let me see if I can create a standalone test for it, for the purposes of this PR.

…eption when lazy properties depend on lazy properties that depend on any other property.

This is achieved by changing a `compute` into a `get` followed by a `put`.
@millems millems force-pushed the millem/endpoint-url-part-1 branch from 66c9e85 to 9ed97a3 Compare September 9, 2024 21:56
Copy link

sonarqubecloud bot commented Sep 9, 2024

@millems millems added this pull request to the merge queue Sep 10, 2024
Merged via the queue into master with commit f28042d Sep 10, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants