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

Context propagation - cleared Arc snapshot should destroy its state once the invocation ends #26968

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

manovotn
Copy link
Contributor

@manovotn manovotn commented Jul 27, 2022

Related to a Zulip thread discussion.
A quick sum up is that this focuses on a scenario where used specifically wants to execute action(s) that will not propagate Arc context and wants a new context instead. This is supported by MP CP. However, in our code, we never destroy any instances created in this new context before we restore previous state which I think is incorrect. However I might be missing some other case where destroying them might be a bad move?

The PR has the needed code adjustment plus a test hopefully showing exactly what I mean with the description above^

Ccing @mkouba and @Ladicek whom I discussed this with. Thoughts, ideas, counterexamples? :)

@manovotn manovotn added area/arc Issue related to ARC (dependency injection) area/context-propagation labels Jul 27, 2022
@quarkus-bot

This comment was marked as outdated.

@manovotn manovotn changed the title Context propagation - cleared Arc snapshot should destroy its state o… Context propagation - cleared Arc snapshot should destroy its state once the invocation ends Jul 27, 2022
@manovotn manovotn force-pushed the cpClearContextIssue branch from cd48537 to d75ab66 Compare July 28, 2022 08:41
@manovotn manovotn marked this pull request as ready for review July 28, 2022 10:58
@manovotn manovotn requested review from mkouba and Ladicek July 28, 2022 11:11
Copy link
Contributor

@Ladicek Ladicek left a comment

Choose a reason for hiding this comment

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

This looks fine to me from ArC/CDI perspective, but if we could get an approval from a ConProp expert, that would be great. @FroMage maybe? :-)

@manovotn
Copy link
Contributor Author

manovotn commented Aug 3, 2022

This is IMO more of an Arc/CDI question than CP itself plus Stef is not currently around.
Personally, I think this should be pretty safe to merge, but I'd like to have at least one more approval from @mkouba as both of us tweaked Arc CP setup before :)

Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

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

My Arc CP tweaks are usually fragile because my CP knowledge is insufficient but this PR looks good.

@mkouba mkouba merged commit 1305b5d into quarkusio:main Aug 3, 2022
@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Aug 3, 2022
@manovotn manovotn deleted the cpClearContextIssue branch August 3, 2022 08:05
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) area/context-propagation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants