Description
During a Spring context close, a pipeline that uses Mono.when(...) can intermittently enter a recursive subscribe/loop. The logs repeatedly show MonoWhen$WhenInner.currentContext alternating with Operators.reportThrowInSubscribe and Mono.subscribe, suggesting a subscription cycle during termination.
Expected Behavior
Shutdown should complete outstanding signals and release resources in order.
No recursive calls to currentContext/subscribe or subscription loops should occur.
Actual Behavior
Repeated stack traces during shutdown indicate recursive/looping subscriptions.
Steps to Reproduce
@Test
void reproCase() {
}
Possible Solution
Your Environment
- Reactor version(s) used: 3.7.8
- Other relevant libraries versions (eg.
netty, ...):
- JVM version (
java -version):
openjdk version "21.0.7" 2025-04-15 LTS
OpenJDK Runtime Environment Zulu21.42+19-CA (build 21.0.7+6-LTS)
OpenJDK 64-Bit Server VM Zulu21.42+19-CA (build 21.0.7+6-LTS, mixed mode, sharing)
- OS and version (eg
uname -a): x86_64 GNU/Linux
Description
During a Spring context close, a pipeline that uses Mono.when(...) can intermittently enter a recursive subscribe/loop. The logs repeatedly show MonoWhen$WhenInner.currentContext alternating with Operators.reportThrowInSubscribe and Mono.subscribe, suggesting a subscription cycle during termination.
Expected Behavior
Shutdown should complete outstanding signals and release resources in order.
No recursive calls to currentContext/subscribe or subscription loops should occur.
Actual Behavior
Repeated stack traces during shutdown indicate recursive/looping subscriptions.
Steps to Reproduce
Possible Solution
Your Environment
netty, ...):java -version):openjdk version "21.0.7" 2025-04-15 LTS
OpenJDK Runtime Environment Zulu21.42+19-CA (build 21.0.7+6-LTS)
OpenJDK 64-Bit Server VM Zulu21.42+19-CA (build 21.0.7+6-LTS, mixed mode, sharing)
uname -a): x86_64 GNU/Linux