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

ArC dev mode - fix business method invocations monitoring #17354

Merged
merged 1 commit into from
May 19, 2021

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented May 19, 2021

- a ConcurrentModificationException may be thrown if async processing
and the request context is not propagated
- resolves quarkusio#17322
@mkouba mkouba requested a review from gsmet May 19, 2021 11:54
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label May 19, 2021
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Added a question. Not sure I fully grasp this but better clarify before merging.

@@ -108,7 +109,8 @@ public String getPackageName(String name) {
private long start;
private long duration;
private Method method;
private List<Builder> children;
// If async processing and the request context is not propagated a new child can be added when/after the builder is built
private final List<Builder> children = new CopyOnWriteArrayList<>();
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make more sense to have a volatile boolean called built or similar that is set to true at the very beginning of build() and exit from addChild() if it's true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that volatile would not be enough in this case, we would have to synchronize the access anyway. CopyOnWriteArrayList should be safe although not so efficient, but that should not be a big problem in the dev mode.

@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 19, 2021
@mkouba mkouba merged commit d3f02db into quarkusio:main May 19, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone May 19, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 19, 2021
@gsmet gsmet modified the milestones: 2.0 - main, 1.13.5.Final May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quarkus random ConcurrentModificationException
2 participants