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

Fix Arc request context state restoration on Vert.x duplicated context which allows to support security events in gRPC #38195

Conversation

michalvavrik
Copy link
Contributor

fixes: #38159

io.quarkus.arc.runtime.context.ArcContextProvider.ContextSnapshot#begin activated new request context because io.quarkus.arc.InjectableContext#getStateIfActive returned deactivated request state. This way, when firing of security events activated request context, the context arrived activate to io.quarkus.grpc.runtime.supports.context.GrpcRequestContextGrpcInterceptor#interceptCall and gRPC auth tests were failing.

This PR enables security events for gRPC because it's also the only reproducer I have.

@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/documentation area/grpc gRPC labels Jan 15, 2024
@quarkus-bot quarkus-bot bot added this to To do in Quarkus Documentation Jan 15, 2024
@michalvavrik
Copy link
Contributor Author

/cc @manovotn @mkouba let's see CI

@michalvavrik michalvavrik force-pushed the feature/fix-arc-slow-ctx-activation-support-grpc-sec-event branch 2 times, most recently from 20085d6 to 1d8eb48 Compare January 15, 2024 14:52
@michalvavrik michalvavrik force-pushed the feature/fix-arc-slow-ctx-activation-support-grpc-sec-event branch from 1d8eb48 to 81a872d Compare January 15, 2024 14:57
Copy link

github-actions bot commented Jan 15, 2024

🙈 The PR is closed and the preview is expired.

Copy link
Contributor

@manovotn manovotn left a comment

Choose a reason for hiding this comment

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

Seems correct from ArC standpoint - this looks like an oversight from when we added context state invalidation handling and didn't adjust the check. Let's see what CI has to say.

@quarkus-bot

This comment has been minimized.

@michalvavrik
Copy link
Contributor Author

michalvavrik commented Jan 15, 2024

I don't think DevMojoIT.testThatNewResourcesAreServed is related, especially as there are no JDK 21 / 17 failures.

@michalvavrik
Copy link
Contributor Author

michalvavrik commented Jan 15, 2024

@sberyozkin please review security events portion

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 15, 2024

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@manovotn
Copy link
Contributor

I don't think DevMojoIT.testThatNewResourcesAreServed is related, especially as there are no JDK 21 / 17 failures.

Yep, it's green after rerun 👍

Copy link
Contributor

@manovotn manovotn left a comment

Choose a reason for hiding this comment

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

Thanks for digging into the grpc bits and spotting this!

Quarkus Documentation automation moved this from To do to Reviewer approved Jan 16, 2024
Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

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

Thanks @michalvavrik

@sberyozkin sberyozkin merged commit f41b7a0 into quarkusio:main Jan 16, 2024
54 checks passed
Quarkus Documentation automation moved this from Reviewer approved to Done Jan 16, 2024
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 16, 2024
@michalvavrik michalvavrik deleted the feature/fix-arc-slow-ctx-activation-support-grpc-sec-event branch January 16, 2024 14:23
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/documentation area/grpc gRPC
Development

Successfully merging this pull request may close these issues.

Investigate request context activation/deactivation in grpc interceptor
4 participants