Origin of this issue is StackOverflow post where I showed some code, but I'll add more details here.
Expected Behavior
After a client is shut down, CPU usage should not increase especially not to >50%.
Actual Behavior
When using the latest version of Spring Boot and its RSocket support (which pulls rsocket-java version 1.1.0), after a client requests a stream of data and it disconnects (manual termination of the client application or Ctrl+C of the rsc CLI), CPU usage gets high (~20%). If more clients are connected and disconnected, CPU usage grows even higher (theoretically it could reach 100% with enough clients).
Steps to Reproduce
I'm attaching Spring Boot application. It's an unfiltered version, meaning I haven't change anything from the point in time when CPU usage was behaving as described. sample-service.zip
Once this service is running, I opened few terminals and run rsc tcp://localhost:8888 --stream --route test in each of them. After ~10 seconds I'd start closing it one by one. As I'm closing them, I can see CPU usage in htop increasing and finally stopping at around 70-80%. Only after service is shut down, CPU usage drops to an idle state. Maybe it's not important, but I had to click that red skull icon in IntelliJ since the application did not properly shut down only with the red square.
Just for the case of completeness, I'm attaching rsocket-kotlin sample-client.zip that can be used to reproduce the same behavior. For this, it's enough to just start/stop the client couple of times.
Your Environment
Arch Linux with Java 13 (uname -a: Linux tara 5.4.39-1-MANJARO #1 SMP PREEMPT Wed May 6 10:36:44 UTC 2020 x86_64 GNU/Linux)
Spring Boot 2.4.3, Kotlin + JVM 11 as a target
RSocket Java 1.1.0
Origin of this issue is StackOverflow post where I showed some code, but I'll add more details here.
Expected Behavior
After a client is shut down, CPU usage should not increase especially not to >50%.
Actual Behavior
When using the latest version of Spring Boot and its RSocket support (which pulls rsocket-java version 1.1.0), after a client requests a stream of data and it disconnects (manual termination of the client application or Ctrl+C of the
rscCLI), CPU usage gets high (~20%). If more clients are connected and disconnected, CPU usage grows even higher (theoretically it could reach 100% with enough clients).Steps to Reproduce
I'm attaching Spring Boot application. It's an unfiltered version, meaning I haven't change anything from the point in time when CPU usage was behaving as described. sample-service.zip
Once this service is running, I opened few terminals and run
rsc tcp://localhost:8888 --stream --route testin each of them. After ~10 seconds I'd start closing it one by one. As I'm closing them, I can see CPU usage inhtopincreasing and finally stopping at around 70-80%. Only after service is shut down, CPU usage drops to an idle state. Maybe it's not important, but I had to click that red skull icon in IntelliJ since the application did not properly shut down only with the red square.Just for the case of completeness, I'm attaching
rsocket-kotlinsample-client.zip that can be used to reproduce the same behavior. For this, it's enough to just start/stop the client couple of times.Your Environment
Arch Linux with Java 13 (
uname -a: Linux tara 5.4.39-1-MANJARO #1 SMP PREEMPT Wed May 6 10:36:44 UTC 2020 x86_64 GNU/Linux)Spring Boot 2.4.3, Kotlin + JVM 11 as a target
RSocket Java 1.1.0