The suspend() extension functions on various Request types will ignore the cancellation instead of throwing an exception when cancelled via a mechanism other then cancelling the coroutine.
In such cases the code that calls suspend() will remain suspended indefinitely.
An example of this is:
Call connect from one coroutine (from within a BleManager):
connect(bluetoothDevice)
.suspend()
While the connect is in progress (within 30 seconds) and before it could succeed, call from another place in the code:
cancelQueue()
While the connection gets cancelled, the first call will remain suspended.
The
suspend()
extension functions on various Request types will ignore the cancellation instead of throwing an exception when cancelled via a mechanism other then cancelling the coroutine.In such cases the code that calls
suspend()
will remain suspended indefinitely.An example of this is: Call connect from one coroutine (from within a
BleManager
):While the connect is in progress (within 30 seconds) and before it could succeed, call from another place in the code:
While the connection gets cancelled, the first call will remain suspended.
This PR is an attempt to fix the problem.