Skip to content

fix(core): terminate requester when dispose is called - #1133

Open
arimu1 wants to merge 1 commit into
rsocket:masterfrom
arimu1:fix/1126-dispose-closes-connection
Open

arimu1 wants to merge 1 commit into
rsocket:masterfrom
arimu1:fix/1126-dispose-closes-connection

Conversation

@arimu1

@arimu1 arimu1 commented Sep 26, 2026 •

Copy link
Copy Markdown

Summary

  • Restore full requester shutdown in RSocketRequester.dispose() after the regression introduced in ensures onClose awaits all underlying components to be closed #1085.
  • Extract tryTerminateAndCloseConnection shared with the keep-alive timeout path so dispose sets termination state and closes the duplex connection (not only sends a connection error frame).
  • Add RSocketRequesterDisposeTest with a Netty-like connection where sendErrorAndClose does not complete onClose.

Fixes #1126

Motivation

On Netty transports, sendErrorAndClose enqueues a final error frame but does not dispose the connection. After #1085, dispose() relied on that alone, so tryShutdown/terminate never ran, onClose did not complete, and the sender could keep emitting frames.

Test plan

  • ./gradlew :rsocket-core:test --tests io.rsocket.core.RSocketRequesterDisposeTest (JBR 17)
  • ./gradlew :rsocket-core:test --tests io.rsocket.core.RSocketRequesterTerminationTest (JBR 17)

After rsocket#1085, RSocketRequester.dispose() only sent a connection error
frame without terminating the requester or closing the duplex
connection on transports where sendErrorAndClose does not complete
onClose. Align dispose with the keep-alive shutdown path and add a
regression test.

Fixes rsocket#1126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dispose doesn't close connection

1 participant