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

Introduce support for Uni return types in Micrometer annotations #22639

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jan 5, 2022

Fixes: #15601

@geoand geoand requested a review from ebullient January 5, 2022 08:10
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 5, 2022

/cc @ebullient

Copy link
Member

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

I made a small comment on the handling of completion stages which does not handle cancellation.

extensions/micrometer/runtime/pom.xml Outdated Show resolved Hide resolved
try {
return ((CompletionStage<?>) context.proceed()).whenComplete((result, throwable) -> {
recordCompletionResult(counted, commonTags, throwable);
return ((CompletionStage<?>) context.proceed()).whenComplete(new BiConsumer<Object, Throwable>() {
Copy link
Member

Choose a reason for hiding this comment

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

The problem with this approach is that you don't catch the cancellation, which means you would not record if the operation is canceled. I believe it's fine if it's documented (like do not use completion stage/ completable future, ever).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm... I didn't actually change this part, I only removed the lambda. So I'll let @ebullient fix it

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 5, 2022

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

Failing Jobs - Building c18cc05

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

Failures

⚙️ Initial JDK 11 Build #

- Failing: extensions/panache/hibernate-orm-panache-common/runtime 
! Skipped: devtools/bom-descriptor-json docs extensions/panache/hibernate-orm-panache-common/deployment and 24 more

📦 extensions/panache/hibernate-orm-panache-common/runtime

Failed to execute goal io.quarkus:quarkus-bootstrap-maven-plugin:999-SNAPSHOT:extension-descriptor (generate-extension-descriptor) on project quarkus-hibernate-orm-panache-common: Execution generate-extension-descriptor of goal io.quarkus:quarkus-bootstrap-maven-plugin:999-SNAPSHOT:extension-descriptor failed: Failed to read /home/runner/work/quarkus/quarkus/extensions/panache/panache-hibernate-common/deployment/target/quarkus-panache-hibernate-common-deployment-999-SNAPSHOT.jar

@geoand
Copy link
Contributor Author

geoand commented Jan 5, 2022

@aloubyansky any idea where the failure is coming from?

Failed to execute goal io.quarkus:quarkus-bootstrap-maven-plugin:999-SNAPSHOT:extension-descriptor (generate-extension-descriptor) on project quarkus-hibernate-orm-panache-common: Execution generate-extension-descriptor of goal io.quarkus:quarkus-bootstrap-maven-plugin:999-SNAPSHOT:extension-descriptor failed: Failed to read /home/runner/work/quarkus/quarkus/extensions/panache/panache-hibernate-common/deployment/target/quarkus-panache-hibernate-common-deployment-999-SNAPSHOT.jar

This PR didn't change anything WRT bootstrap.

@geoand
Copy link
Contributor Author

geoand commented Jan 5, 2022

@aloubyansky I wonder if this is related to #22336

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 5, 2022

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

Failing Jobs - Building 8d0a952

Status Name Step 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

Full information is available in the Build summary check run.

Failures

⚙️ JVM Tests - JDK 11 #

- Failing: extensions/micrometer/deployment 
! Skipped: extensions/micrometer-registry-prometheus/deployment extensions/quartz/deployment extensions/scheduler/deployment and 19 more

📦 extensions/micrometer/deployment

io.quarkus.micrometer.deployment.binder.HttpDevModeConfigTest.test line 39 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

⚙️ JVM Tests - JDK 11 Windows #

- Failing: extensions/micrometer/deployment 
! Skipped: extensions/micrometer-registry-prometheus/deployment extensions/quartz/deployment extensions/scheduler/deployment and 19 more

📦 extensions/micrometer/deployment

io.quarkus.micrometer.deployment.binder.HttpDevModeConfigTest.test line 39 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

⚙️ JVM Tests - JDK 17 #

- Failing: extensions/micrometer/deployment 
! Skipped: extensions/micrometer-registry-prometheus/deployment extensions/quartz/deployment extensions/scheduler/deployment and 19 more

📦 extensions/micrometer/deployment

io.quarkus.micrometer.deployment.binder.HttpDevModeConfigTest.test line 39 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

@aloubyansky
Copy link
Member

Yes, it looks like it. I'll try to reproduce and fix it. I'm wondering why I haven't seen this kind of failure before. I wanted to refactor the ApplicationArchive stuff too but thought of doing it is a separate PR. Feel free to revert my PR for now.

@geoand
Copy link
Contributor Author

geoand commented Jan 5, 2022

Hm... I think it didn't fail this time...

@geoand
Copy link
Contributor Author

geoand commented Jan 5, 2022

Ah, now there are different failures:

2022-01-05T09:51:18.0424204Z 2022-01-05 09:51:17,886 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (vert.x-worker-thread-0) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
2022-01-05T09:51:18.0427462Z 	[error]: Build step io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor#addStaticResourcesExceptionMapper threw an exception: java.nio.file.ClosedFileSystemException
2022-01-05T09:51:18.0430453Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1146)
2022-01-05T09:51:18.0431947Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.checkAccess(ZipFileSystem.java:362)
2022-01-05T09:51:18.0433439Z 	at jdk.zipfs/jdk.nio.zipfs.ZipPath.checkAccess(ZipPath.java:843)
2022-01-05T09:51:18.0434975Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.checkAccess(ZipFileSystemProvider.java:185)
2022-01-05T09:51:18.0436962Z 	at java.base/java.nio.file.Files.exists(Files.java:2440)
2022-01-05T09:51:18.0438200Z 	at io.quarkus.paths.PathList.resolveExistingOrNull(PathList.java:121)
2022-01-05T09:51:18.0440039Z 	at io.quarkus.deployment.ApplicationArchive.getChildPath(ApplicationArchive.java:93)
2022-01-05T09:51:18.0443454Z 	at io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor.lambda$addStaticResourcesExceptionMapper$0(ResteasyBuiltinsProcessor.java:120)
2022-01-05T09:51:18.0446285Z 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
2022-01-05T09:51:18.0447679Z 	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1621)
2022-01-05T09:51:18.0449132Z 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2022-01-05T09:51:18.0450924Z 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
2022-01-05T09:51:18.0452620Z 	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
2022-01-05T09:51:18.0454278Z 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2022-01-05T09:51:18.0455876Z 	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
2022-01-05T09:51:18.0460089Z 	at io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor.addStaticResourcesExceptionMapper(ResteasyBuiltinsProcessor.java:123)
2022-01-05T09:51:18.0463432Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-01-05T09:51:18.0465566Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-01-05T09:51:18.0468015Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-01-05T09:51:18.0469850Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2022-01-05T09:51:18.0471233Z 	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:887)
2022-01-05T09:51:18.0472477Z 	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
2022-01-05T09:51:18.0473634Z 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
2022-01-05T09:51:18.0474997Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2022-01-05T09:51:18.0476628Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2022-01-05T09:51:18.0477829Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2022-01-05T09:51:18.0478906Z 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
2022-01-05T09:51:18.0479986Z 
2022-01-05T09:51:18.0539422Z 	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
2022-01-05T09:51:18.0542324Z 	at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:265)
2022-01-05T09:51:18.0545928Z 	at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:60)
2022-01-05T09:51:18.0548842Z 	at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:231)
2022-01-05T09:51:18.0551505Z 	at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:214)
2022-01-05T09:51:18.0554064Z 	at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:522)
2022-01-05T09:51:18.0556795Z 	at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:423)
2022-01-05T09:51:18.0560734Z 	at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$4.handle(VertxHttpHotReplacementSetup.java:152)
2022-01-05T09:51:18.0564270Z 	at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$4.handle(VertxHttpHotReplacementSetup.java:139)
2022-01-05T09:51:18.0566782Z 	at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159)
2022-01-05T09:51:18.0568127Z 	at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
2022-01-05T09:51:18.0569534Z 	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157)
2022-01-05T09:51:18.0571107Z 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
2022-01-05T09:51:18.0572458Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2022-01-05T09:51:18.0574204Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2022-01-05T09:51:18.0575882Z 	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
2022-01-05T09:51:18.0578429Z 	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
2022-01-05T09:51:18.0580749Z 	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
2022-01-05T09:51:18.0582301Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2022-01-05T09:51:18.0583531Z Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
2022-01-05T09:51:18.0586557Z 	[error]: Build step io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor#addStaticResourcesExceptionMapper threw an exception: java.nio.file.ClosedFileSystemException
2022-01-05T09:51:18.0589908Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1146)
2022-01-05T09:51:18.0591719Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.checkAccess(ZipFileSystem.java:362)
2022-01-05T09:51:18.0594002Z 	at jdk.zipfs/jdk.nio.zipfs.ZipPath.checkAccess(ZipPath.java:843)
2022-01-05T09:51:18.0596954Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.checkAccess(ZipFileSystemProvider.java:185)
2022-01-05T09:51:18.0598586Z 	at java.base/java.nio.file.Files.exists(Files.java:2440)
2022-01-05T09:51:18.0599916Z 	at io.quarkus.paths.PathList.resolveExistingOrNull(PathList.java:121)
2022-01-05T09:51:18.0762485Z 	at io.quarkus.deployment.ApplicationArchive.getChildPath(ApplicationArchive.java:93)
2022-01-05T09:51:18.0765529Z 	at io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor.lambda$addStaticResourcesExceptionMapper$0(ResteasyBuiltinsProcessor.java:120)
2022-01-05T09:51:18.0768343Z 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
2022-01-05T09:51:18.0769970Z 	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1621)
2022-01-05T09:51:18.0771551Z 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2022-01-05T09:51:18.0773459Z 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
2022-01-05T09:51:18.0775359Z 	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
2022-01-05T09:51:18.0776899Z 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2022-01-05T09:51:18.0778538Z 	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
2022-01-05T09:51:18.0789036Z 	at io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor.addStaticResourcesExceptionMapper(ResteasyBuiltinsProcessor.java:123)
2022-01-05T09:51:18.0792564Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-01-05T09:51:18.0795147Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-01-05T09:51:18.0802295Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-01-05T09:51:18.0804411Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2022-01-05T09:51:18.0805817Z 	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:887)
2022-01-05T09:51:18.0807921Z 	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
2022-01-05T09:51:18.0809212Z 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
2022-01-05T09:51:18.0811035Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2022-01-05T09:51:18.0812703Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2022-01-05T09:51:18.0813943Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2022-01-05T09:51:18.0814870Z 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
2022-01-05T09:51:18.0815578Z 
2022-01-05T09:51:18.0816261Z 	at io.quarkus.builder.Execution.run(Execution.java:116)
2022-01-05T09:51:18.0817736Z 	at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
2022-01-05T09:51:18.0819453Z 	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:160)
2022-01-05T09:51:18.0821299Z 	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:328)
2022-01-05T09:51:18.0822539Z 	... 18 more
2022-01-05T09:51:18.0823285Z Caused by: java.nio.file.ClosedFileSystemException
2022-01-05T09:51:18.0824555Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.ensureOpen(ZipFileSystem.java:1146)
2022-01-05T09:51:18.0825993Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.checkAccess(ZipFileSystem.java:362)
2022-01-05T09:51:18.0827282Z 	at jdk.zipfs/jdk.nio.zipfs.ZipPath.checkAccess(ZipPath.java:843)
2022-01-05T09:51:18.0828827Z 	at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.checkAccess(ZipFileSystemProvider.java:185)
2022-01-05T09:51:18.0830265Z 	at java.base/java.nio.file.Files.exists(Files.java:2440)
2022-01-05T09:51:18.0831474Z 	at io.quarkus.paths.PathList.resolveExistingOrNull(PathList.java:121)
2022-01-05T09:51:18.0833314Z 	at io.quarkus.deployment.ApplicationArchive.getChildPath(ApplicationArchive.java:93)
2022-01-05T09:51:18.0836191Z 	at io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor.lambda$addStaticResourcesExceptionMapper$0(ResteasyBuiltinsProcessor.java:120)
2022-01-05T09:51:18.0838771Z 	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
2022-01-05T09:51:18.0840323Z 	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1621)
2022-01-05T09:51:18.0842360Z 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
2022-01-05T09:51:18.0844079Z 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
2022-01-05T09:51:18.0845865Z 	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
2022-01-05T09:51:18.0847387Z 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
2022-01-05T09:51:18.0849033Z 	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
2022-01-05T09:51:18.0852207Z 	at io.quarkus.resteasy.deployment.ResteasyBuiltinsProcessor.addStaticResourcesExceptionMapper(ResteasyBuiltinsProcessor.java:123)
2022-01-05T09:51:18.0855803Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-01-05T09:51:18.0857925Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-01-05T09:51:18.0861809Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-01-05T09:51:18.0863766Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2022-01-05T09:51:18.0865255Z 	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:887)
2022-01-05T09:51:18.0866715Z 	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
2022-01-05T09:51:18.0867908Z 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
2022-01-05T09:51:18.0869330Z 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2022-01-05T09:51:18.0871002Z 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2022-01-05T09:51:18.0872243Z 	at java.base/java.lang.Thread.run(Thread.java:829)
2022-01-05T09:51:18.0873445Z 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

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.

Timed annotation not working properly for reactive methods / futures
3 participants