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

Failed to bind after upgrading to java 21 #679

Closed
pbthorste opened this issue Jan 31, 2024 · 4 comments · Fixed by #702
Closed

Failed to bind after upgrading to java 21 #679

pbthorste opened this issue Jan 31, 2024 · 4 comments · Fixed by #702
Assignees

Comments

@pbthorste
Copy link

Expected Behavior

The application should have started without logging a warning

Actual Behaviour

After application was configured to use java 21 - at startup, the application logs this warning:

level=WARN  : Failed to bind as java.util.concurrent.ThreadPerTaskExecutor is unsupported. thrd=[main] logger=io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics

Not sure if this is a micronaut or a micrometer issue.

Steps To Reproduce

No response

Environment Information

Operating system: Linux
JDK: 21 (coretto)

Example Application

No response

Version

4.2.2

@jeremyg484
Copy link
Contributor

It looks like Micrometer does not provide any instrumentation for an ExecutorService that uses virtual threads. See micrometer-metrics/micrometer#3650 and micrometer-metrics/micrometer#3956.

I think the appropriate thing for us to do is detect usage of virtual threads in our ExecutorServiceMetricsBinder and not try to bind ExecutorServiceMetrics in that case.

Given that, I believe this particular warning can be safely ignored in the meantime.

jeremyg484 added a commit that referenced this issue Mar 4, 2024
ExecutorServiceMetricsBinder is updated to not attempt to bind
ExecutorServiceMetrics to a ThreadPerTaskExecutor which is used in the
case of virtual threads and is not supported by ExecutorServiceMetrics.

Resolves #679
@jeremyg484 jeremyg484 moved this to Ready for Review in 4.4.0 Release Mar 4, 2024
@jeremyg484 jeremyg484 moved this to Ready for Review in 4.3.5 Release Mar 5, 2024
jeremyg484 added a commit that referenced this issue Mar 5, 2024
ExecutorServiceMetricsBinder is updated to not attempt to bind
ExecutorServiceMetrics to a ThreadPerTaskExecutor which is used in the
case of virtual threads and is not supported by ExecutorServiceMetrics.

Resolves #679
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in 4.3.5 Release Mar 5, 2024
@pbthorste
Copy link
Author

Thank you @jeremyg484 :)

@mdeso
Copy link

mdeso commented Apr 3, 2024

I still get this warning with Micronaut platform 4.3.7, micronaut-micrometer 5.4.0

@jeremyg484
Copy link
Contributor

I still get this warning with Micronaut platform 4.3.7, micronaut-micrometer 5.4.0

It did not end up getting included in the 4.3.x releases as we've not done an updated release of this module yet. It should definitely get included in 4.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants