You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RpcClient must be given a Channel upon construction and if used in mandatory-mode, the constructor adds a ReturnListener to this channel. However, this listener is never removed. It should be removed in the close-method.
Reproduction steps
Instantiate RpcClient in mandatory-mode.
Publish an unrouteable RPC message with the client and catch the UnrouteableRpcRequestException.
Close the RpcClient.
Repeat 1.-3. using the same channel.
Observe that first there will be an exception, then there will be an exception and a log-warning, then an exception and two log-warnings, then an exception and three log-warnings and so on. The reason is that each new RpcClient adds its own ReturnListener. One of them throws the exception, the other log warnings, because they look up the returned message in the previous RpcClient's continuation maps.
The log messages are annoying, but more importantly, the listeners accumulate over time and live for as long as the channel stays open.
Expected behavior
Closing an RpcClient should clean up thoroughly, including the removal of the ReturnListener so that the channel may be reused.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Also note that this class is an example you can and should modify/build upon. But maybe that's exactly why we should make it clean any ReturnListeners it adds.
Describe the bug
RpcClient
must be given a Channel upon construction and if used in mandatory-mode, the constructor adds aReturnListener
to this channel. However, this listener is never removed. It should be removed in theclose
-method.Reproduction steps
RpcClient
in mandatory-mode.UnrouteableRpcRequestException
.RpcClient
.Observe that first there will be an exception, then there will be an exception and a log-warning, then an exception and two log-warnings, then an exception and three log-warnings and so on. The reason is that each new
RpcClient
adds its ownReturnListener
. One of them throws the exception, the other log warnings, because they look up the returned message in the previousRpcClient
's continuation maps.The log messages are annoying, but more importantly, the listeners accumulate over time and live for as long as the channel stays open.
Expected behavior
Closing an
RpcClient
should clean up thoroughly, including the removal of theReturnListener
so that the channel may be reused.Additional context
No response
The text was updated successfully, but these errors were encountered: