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
I create a Client singleton object and open/close a single connection on that Client only whenever I need to consume from RabbitMQ. I can open and close a connection just fine the first time, but when I open a connection a second time on that same Client object, that connection doesn't close.
This is because of the check on line 237 in client_impl.dart:
if (_clientClosed != null) { return _clientClosed.future; }
_clientClosed is set to null when the Client object is first created, but after the connection itself is closed, _clientClosed isn't set back to null. This means the check above always returns a Future, rather than proceeding to the code to close the connection.
It could be that the library doesn't intend for Clients to be re-used like this, but my assumption was it's okay to re-use a Client. Right now as a work-around I just create a new Client object each time I need to establish a new connection to RabbitMQ.
I could submit a fix for this, but wanted to ensure that you all agree this is a bug and how to write unit tests for this.
Thanks!
The text was updated successfully, but these errors were encountered:
I create a Client singleton object and open/close a single connection on that Client only whenever I need to consume from RabbitMQ. I can open and close a connection just fine the first time, but when I open a connection a second time on that same Client object, that connection doesn't close.
This is because of the check on line 237 in client_impl.dart:
if (_clientClosed != null) { return _clientClosed.future; }
_clientClosed is set to null when the Client object is first created, but after the connection itself is closed, _clientClosed isn't set back to null. This means the check above always returns a Future, rather than proceeding to the code to close the connection.
It could be that the library doesn't intend for Clients to be re-used like this, but my assumption was it's okay to re-use a Client. Right now as a work-around I just create a new Client object each time I need to establish a new connection to RabbitMQ.
I could submit a fix for this, but wanted to ensure that you all agree this is a bug and how to write unit tests for this.
Thanks!
The text was updated successfully, but these errors were encountered: