rsocket / rsocket-java

Java implementation of RSocket
http://rsocket.io
Apache License 2.0
2.35k stars 354 forks source link

Select RSocket from the pool when retrying requestChannel #1084

Closed Alex079 closed 1 year ago

Alex079 commented 1 year ago

rSocketPool.select() in method requestChannel should be called on each subscription as it is done in other methods of the class.

Motivation:

When server restarts while client is still connected, LoadbalanceRSocketClient is not able to reconnect when retrying requestChannel Flux. Retry fails with the error "Only a single Subscriber allowed".

Modifications:

Wrap rSocketPool.select() in Mono.

Result:

Retrying requestChannel Flux should trigger connection attempt.

Target branch:

I cannot create a new base branch in rsocket-java as described in contribution guidelines. Creating the PR on master instead.

OlegDokuka commented 1 year ago

Hi @Alex079!

Indeed it is a bug. Do you mind writing a test for that as well?

Thanks, Oleh

Alex079 commented 1 year ago

hello @OlegDokuka,

I will find some time to finish it this week.

Thanks, Alex

Alex079 commented 1 year ago

I have added the test. Could you please check?

OlegDokuka commented 1 year ago

@Alex079 can you please rebase on 1.1.x branch. Thanks

OlegDokuka commented 1 year ago

closed in favor of #1086