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
Discovered inadvertently during the investigation of #917.
If you use the autoconnect option in ClientOptions and also call connect on the ably instance, a race condition exists whereby threads are leaked from the underlying websocket handler.
This is because starting connections discards the current transport, calling transport.close(). The underlying websocket library only cleans up threads properly if the write thread (which is started by the read thread) isn't null.
With quick calls to connect, you can end up in a case where the write thread isn't yet started. This means that when the transport is closed, the read thread is left running, the write thread gets created - and neither can be cleaned up.
The issue is complicated by the fact that connecting is an asynchronous state change.
Discovered inadvertently during the investigation of #917.
If you use the autoconnect option in
ClientOptions
and also callconnect
on the ably instance, a race condition exists whereby threads are leaked from the underlying websocket handler.This is because starting connections discards the current transport, calling
transport.close()
. The underlying websocket library only cleans up threads properly if thewrite
thread (which is started by theread
thread) isn't null.With quick calls to
connect
, you can end up in a case where thewrite thread
isn't yet started. This means that when the transport is closed, theread
thread is left running, thewrite
thread gets created - and neither can be cleaned up.The issue is complicated by the fact that
connecting
is an asynchronous state change.┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: