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

Make copying of Vertx context data conditional #22766

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jan 10, 2022

In order to avoid negatively affecting RESTEasy Reactive performance
just to serve very specific use cases, we introduce a way to
conditionally control when the current Vertx request context data needs
to be copied into the connection context

Follow up of: #22671

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 10, 2022

/cc @radcortez

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 10, 2022

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 71a7f81

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build Build Failures Logs Raw logs

Failures

⚙️ Initial JDK 11 Build #

- Failing: extensions/opentelemetry/opentelemetry/deployment 
! Skipped: docs extensions/opentelemetry/opentelemetry-exporter-jaeger/deployment extensions/opentelemetry/opentelemetry-exporter-otlp/deployment and 4 more

📦 extensions/opentelemetry/opentelemetry/deployment

Failed to execute goal net.revelc.code:impsort-maven-plugin:1.6.2:check (check-imports) on project quarkus-opentelemetry-deployment: Imports are not sorted in /home/runner/work/quarkus/quarkus/extensions/opentelemetry/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/OpenTelemetryProcessor.java

@gsmet
Copy link
Member

gsmet commented Jan 10, 2022

Note that this shouldn't be seen as a fix for the potential regression performance and we still need to check it. Because, if we end up doing this a lot, we will have users with an app that is working fine and that has degraded performance when adding telemetry.

@geoand
Copy link
Contributor Author

geoand commented Jan 10, 2022

Still need to check what? I am not following

@gsmet
Copy link
Member

gsmet commented Jan 10, 2022

The penalty of what @radcortez introduced and if it should be done this way. I don't want us to have a very optimized thing that falls apart when you add telemetry :).

BTW, I'm not against this PR, just that it doesn't prevent us from making sure the penalty is not too big.

@geoand
Copy link
Contributor Author

geoand commented Jan 10, 2022

Sure, checking further should be a next step, but it's entirely possible that we won't be able to avoid this type of copying for the case of telemetry.

@geoand
Copy link
Contributor Author

geoand commented Jan 10, 2022

Also, it's a given that any sort of telemetry will add some overhead.

What we don't want is to pay that price if no telemetry is needed

@radcortez
Copy link
Member

We can probably make it even smarter, by only copying the context if the trace is sampled. Anyway, it would be interesting to measure the performance hit, not only for this case but for telemetry overall.

Let me add that to my TODO list :)

@Sanne
Copy link
Member

Sanne commented Jan 10, 2022

It concerns me that such a "condition" might be yet-another source of things that breaks or magically get fixed when an extension is added [removed]. We need to be careful in making things nicely composeable for Quarkus to be a viable platform for non-trivial applications; maybe best to explore such options only if we see there is a performance problem?

Also wondering: does telemetry need the whole map or is it needing some specific element? If we could "copy" only what it needs, at least it wouldn't have unexpected side-effects. In which case, perhaps what we need is a similar BuildItem, but which allows registering what exactly needs to be copied.

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 10, 2022

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building d5bc289

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 11 Windows Build Failures Logs Raw logs
JVM Tests - JDK 17 Build Failures Logs Raw logs
MicroProfile TCKs Tests Verify Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.devmode.CompositeBuildWithDependenciesDevModeTest.main line 24 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.test.devmode.util.DevModeTestUtils that uses java.util.function.Supplier, java.util.function.Supplierjava.util.concurrent.atomic.AtomicReference, java.util.concurrent.atomic.AtomicReferencejava.lang.String, java.lang.Stringboolean was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:164)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

⚙️ JVM Tests - JDK 11 #

- Failing: integration-tests/opentelemetry-vertx 

📦 integration-tests/opentelemetry-vertx

io.quarkus.it.opentelemetry.vertx.HelloRouterTest.span - More details - Source on GitHub

java.lang.RuntimeException: java.util.ServiceConfigurationError: io.smallrye.config.SmallRyeConfigFactory: io.quarkus.runtime.configuration.QuarkusConfigFactory not a subtype
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:593)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:666)

⚙️ JVM Tests - JDK 11 Windows #

- Failing: integration-tests/opentelemetry-vertx 

📦 integration-tests/opentelemetry-vertx

io.quarkus.it.opentelemetry.vertx.HelloRouterTest.span - More details - Source on GitHub

java.lang.RuntimeException: java.util.ServiceConfigurationError: io.smallrye.config.SmallRyeConfigFactory: io.quarkus.runtime.configuration.QuarkusConfigFactory not a subtype
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:593)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:666)

⚙️ JVM Tests - JDK 17 #

- Failing: integration-tests/opentelemetry-vertx 

📦 integration-tests/opentelemetry-vertx

io.quarkus.it.opentelemetry.vertx.HelloRouterTest.span - More details - Source on GitHub

java.lang.RuntimeException: java.util.ServiceConfigurationError: io.smallrye.config.SmallRyeConfigFactory: io.quarkus.runtime.configuration.QuarkusConfigFactory not a subtype
	at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:593)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:666)

⚙️ MicroProfile TCKs Tests #

- Failing: tcks/microprofile-fault-tolerance 

📦 tcks/microprofile-fault-tolerance

org.eclipse.microprofile.fault.tolerance.tck.TimeoutUninterruptableTest.testTimeoutAsyncBulkhead line 190 - More details - Source on GitHub

java.lang.AssertionError: Unexpected exception thrown from Future
	at org.testng.Assert.fail(Assert.java:85)
	at org.eclipse.microprofile.fault.tolerance.tck.util.Exceptions.expect(Exceptions.java:98)

@radcortez
Copy link
Member

radcortez commented Jan 10, 2022

Also wondering: does telemetry need the whole map or is it needing some specific element? If we could "copy" only what it needs, at least it wouldn't have unexpected side-effects. In which case, perhaps what we need is a similar BuildItem, but which allows registering what exactly needs to be copied.

Yes, the entire map is not required. We can just copy the specific element that carries the OTel context. When I wrote the fix, I thought about it, but I didn't want to be specific about OTel, so a build item to copy specific things sounds better.

@geoand
Copy link
Contributor Author

geoand commented Jan 10, 2022

I updated the PR to use the named approach

@geoand geoand force-pushed the #22671-follow-up branch 2 times, most recently from 3c06f34 to 71eebdd Compare January 10, 2022 17:37
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 10, 2022

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 71eebdd

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build Build Failures Logs Raw logs

Failures

⚙️ Initial JDK 11 Build #

- Failing: extensions/opentelemetry/opentelemetry/deployment 
! Skipped: docs extensions/opentelemetry/opentelemetry-exporter-jaeger/deployment extensions/opentelemetry/opentelemetry-exporter-otlp/deployment and 4 more

📦 extensions/opentelemetry/opentelemetry/deployment

Failed to execute goal net.revelc.code:impsort-maven-plugin:1.6.2:check (check-imports) on project quarkus-opentelemetry-deployment: Imports are not sorted in /home/runner/work/quarkus/quarkus/extensions/opentelemetry/opentelemetry/deployment/src/main/java/io/quarkus/opentelemetry/deployment/OpenTelemetryProcessor.java

In order to avoid negatively affecting RESTEasy Reactive performance
just to serve very specific use cases, we introduce a way to
conditionally control when the current Vertx request context data needs
to be copied into the connection context

Follow up off: quarkusio#22671
@geoand geoand requested a review from radcortez January 11, 2022 14:17
@geoand geoand merged commit bf06169 into quarkusio:main Jan 11, 2022
@geoand geoand deleted the #22671-follow-up branch January 11, 2022 17:37
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants