rsocket / rsocket-net

.NET implementation of RSocket
Apache License 2.0
252 stars 42 forks source link

IRSocketProtocol.Error is not implemented (mentioned as a TODO) #17

Open AmrutAnegundi opened 4 years ago

AmrutAnegundi commented 4 years ago

Currently in the RSocket Library we don't have a mechanism to handle errors coming from server. I also observed that the observer is not being removed from the Dispatcher map used internally. This will increase memory over time is my belief. The streamId used to push to Dispatcher map is also int and will overflow over time and should fail in the long run. Correct me if I am wrong on this. I have copied the screenshots below for reference,

Screen Shot 2020-08-13 at 5 51 40 PM Screen Shot 2020-08-13 at 5 54 33 PM Screen Shot 2020-08-13 at 6 16 27 PM

Expected Behavior

We should get the OnError callback for System.IObserver<(System.Buffers.ReadOnlySequence metadata, System.Buffers.ReadOnlySequence data)> object that is passed in our case RequestReponse function. The object must be disposed from the Dispatcher map once there is no further reference to it. We must reuse streamid so that it will work infinitely.

Actual Behavior

No callback in case of an error from the server

Steps to Reproduce

1.Send a RequestResponse to a server and let the server respond back with some error @Test public void reproCase() {

}



## Possible Solution
<!--- Not obligatory, but you can suggest a fix/reason for the bug. -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in. -->
<!--- Especially, always include the version(s) of RSocket library/libraries you used! -->

* RSocket version(s) used:
* Other relevant libraries versions (eg. `netty`, ...):
* Platform (eg. JVM version (`javar -version`) or Node version (`node --version`)):
* OS and version (eg `uname -a`):