-
Notifications
You must be signed in to change notification settings - Fork 642
Open
Description
We were sometimes seeing the Plc connection being closed when cancelling a WriteBytesAsync/ReadBytesAsync which then lead to random ObjectDisposedExceptions as in #528
I traced this back to this line in NoLockRequestTsduAsync:
using var closeOnCancellation = cancellationToken.Register(Close);
I guess this is because the WriteAsync/ReadAsync query-response pair in NoLockRequestTsduAsync cannot easily be split, but I still found this behavior surprising. Right now, our workaround is not to pass in the CancellationToken at all and just hope that each query is fast enough. Is there a better way of handling this? Maybe only cancelling the task that the user is waiting on but not the query itself once it is running?
Metadata
Metadata
Assignees
Labels
No labels