-
Notifications
You must be signed in to change notification settings - Fork 353
RejectedSetupException on auth failure results in ClosedChannelException #1092
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
Comments
Just FYI, I filed what seems like a very similar regression between 1.1.2 and 1.1.3: #1087. |
I just want to add here that this is blocking us (and probably others) from upgrading to 1.1.4. @OlegDokuka Do you know of a suitable workaround for this bug? |
@mdindoffer I'm back to work. Let me fix it quickly! Thank you for being patient all that time! |
@OlegDokuka I understand this is not a priority for you, and that's fine. But we'd really love to upgrade the rest of the reactive stack at least (i.e. bumping the whole reactor-bom). So please forgive me for asking again - is there a way to decouple RSocket from the rest of the Reactor stack (core, reactor-netty, netty) in a way that enables safe upgrade path with RSocket 1.1.3? See #1082 (comment) . I imagine locking individual netty artifacts is a bad idea. Alternatively, can you think of a workaround for the premature closing of the channel? |
After debugging with @OlegDokuka we've narrowed this. Commit c65683e intended to change how This works okay, and Reactor Netty writes the error frame, but it is not flushed immediately. As the setup is rejected from a doOnNext callback, the error signal continues to propagate unhandled until it reaches Reactor Netty in |
Closes rsocketgh-1092
Closes gh-1092 Signed-off-by: rstoyanchev <rossen.stoyanchev@broadcom.com>
Superseded by #1117. |
Fixes rsocketgh-1092 Signed-off-by: rstoyanchev <rossen.stoyanchev@broadcom.com>
RSocket server can do connection-level authentication checks via
socketAcceptor
interceptors. An interceptor can check for valid authentication in the setup payload and decide whether to forward the accept the connection, or reply with aMono#error
ofio.rsocket.exceptions.RejectedSetupException
with rejection details in the exception message.This authentication approach has worked flawlessly on 1.1.3, but on 1.1.4 the clients don't receive the
RejectedSetupException
anymore. Rather the connection is abruptly closed withClosedChannelException
.Expected Behavior
Clients should receive the error with
RejectedSetupException
throwable containing the details when authentication fails.Actual Behavior
The TCP connection is eagerly shut down and clients receive
java.nio.channels.ClosedChannelException
.I tried bisecting the commits since the 1.1.3 git tag and it seems it works fine until at least
00d8311a7436fd2421dbcefb13f744bc4973184e
, and then it gets weird, but I'm not sure if those next commits are self-contained changes...Steps to Reproduce
The following example runs fine with 1.1.3, but fails with 1.1.4:
Your Environment
The text was updated successfully, but these errors were encountered: