Skip to content

reactor-tcp-epoll not reliably created when using native images #4005

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

Closed
klopfdreh opened this issue Mar 6, 2025 · 7 comments
Closed

reactor-tcp-epoll not reliably created when using native images #4005

klopfdreh opened this issue Mar 6, 2025 · 7 comments
Labels
for/other-project This issue belongs to another project

Comments

@klopfdreh
Copy link

klopfdreh commented Mar 6, 2025

Expected Behavior

The thread pool is created and everthing is working like expected

Actual Behavior

Sometimes the thread pool is not created and the rsocket subscription is just running in a timeout - I just thought this is a problem of the specific implementation of Prometheus RSocket Proxy, but the more I digg into it the more I think this is an issue that the reactor-tcp-epoll pool is not created within native images created with graalvm - for more information see: micrometer-metrics/prometheus-rsocket-proxy#94

Steps to Reproduce

I created a setup to create native images and to test it against a local running Prometheus RSocket Proxy: https://github.com/klopfdreh/prometheus-rsocket-native-test - but sadly I was not able to reproduce it without K8 setup.

Possible Solution

N/A

Your Environment

  • Reactor version(s) used:
  • reactor-core 3.7.3
  • GraalVM: bellsoft-liberica-vm-openjdk23+38-24.1.0+1-linux-amd64.tar.gz
  • Prometheus RSocket Proxy 2.0.0-RC1
  • Netty 4.1.118.Final
  • Spring Boot 3.4.3
@klopfdreh klopfdreh changed the title reactor-tcp-epoll not created when using native images reactor-tcp-epoll not reliably created when using native images Mar 6, 2025
@chemicL
Copy link
Member

chemicL commented Mar 6, 2025

Hey, @klopfdreh. Can you explain why do you think this issue belongs in the reactor-core repo? reactor-tcp-epoll is not a pool created nor managed using reactor-core. I have seen in micrometer-metrics/prometheus-rsocket-proxy#94 that there was no feedback from maintainers yet, so perhaps we can close this issue and reopen in case you get some pointers and find a reproducer without external dependencies that shows reactor-core is at fault.

@chemicL chemicL added the status/need-user-input This needs user input to proceed label Mar 6, 2025
@klopfdreh
Copy link
Author

klopfdreh commented Mar 6, 2025

Hey @chemicL - thanks for the your fast answer. So I first created the ticket at prometheus-rsocket-proxy because this is the framework we use and which shows the issue. I did some code refactoring to see what's going on which is a good improvement. After some debugging I just saw that that all related code which should be executed and is not in case of that error was executed in a thread pool mentioning reactor-tcp*. Because of this I thought it is not that specific implementation of prometheus-rsocket-proxy, but the underlying frameworks, but it also affects prometheus-rsocket-proxy. That's the reason why I opened the ticket here.

So maybe it could also be an issue of io.rsocket.core as it only uses reactor to implement the subscription behavior based on rsocket protocol. That I don't know for sure.

@chemicL
Copy link
Member

chemicL commented Mar 6, 2025

If you can reproduce this with bare RSocket but not the underlying libraries, perhaps the issue is best suited in the RSocket issue tracker. RSocket also uses reactor-netty. So there is some narrowing down required. Once we can isolate the issue to something that can be shown, using a minimal reproducer, that is a reactor-core bug, I'd be happy to investigate. For now, I'll close the issue. Please reopen if you have such a reproducer. Thanks.

@chemicL chemicL closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2025
@chemicL chemicL added for/other-project This issue belongs to another project and removed status/need-user-input This needs user input to proceed labels Mar 6, 2025
@klopfdreh
Copy link
Author

I created a ticket at io.rsocket: rsocket/rsocket-java#1122

If this ticket is going to be required as you mention, I am going re-open it. Thanks a lot for your help 👍

@klopfdreh
Copy link
Author

Hey @chemicL - just wanted to let you know that we tested to switch to Java 21 and Virtual Threads and compiled native images of those binary files which fixed this issue.

@chemicL
Copy link
Member

chemicL commented Mar 10, 2025

@klopfdreh thanks for the heads-up. Did you manage to find the root cause of the issue with Java 17? I wonder if any of the involved libraries could fix something.

@klopfdreh
Copy link
Author

@chemicL sadly not - it can be prometheus-rsocket-proxy over io.rsocket all the way down to te thread implementation of JDK / JRE 21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for/other-project This issue belongs to another project
Projects
None yet
Development

No branches or pull requests

2 participants