when async operation fails with ERROR_OPERATION_ABORTED, we should ignore numBytes that can be != 0#57229
Conversation
…nore numBytes that can be != 0
|
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsIn #57212, I've validated that when async fixes #56894
|
|
Hello @adamsitnik! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
carlossanlop
left a comment
There was a problem hiding this comment.
LGTM. Just a small optional suggestion to add a comment.
|
|
||
| default: | ||
| // Failure | ||
| strategy?.OnIncompleteOperation(_bufferSize, 0); |
There was a problem hiding this comment.
Do we care to add a comment here explaining why 0 for the default case?
In #57212, I've validated that when async
WriteFileoperation fails withERROR_OPERATION_ABORTED, the reported number of transferred bytes can be different than zero. Moreover, its value can be bigger than the number of bytes that we have requested to transfer when the operation was started, so we can assume that this value is always invalid in such case and just use zero instead.fixes #56894