-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A partial fix for issue #1191. Do not panic mio on sockstate error, i… #1215
Conversation
src/sys/windows/selector.rs
Outdated
@@ -122,7 +127,12 @@ impl SockState { | |||
* events that the user is interested in. Therefore, cancel the pending | |||
* poll operation; when we receive it's completion package, a new poll | |||
* operation will be submitted with the correct event mask. */ | |||
self.cancel()?; | |||
let result = self.cancel(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to find any documentation on NtCancelIoFileEx
(the system call made here), do you have a documentation @dtacalau?
I want to know what kind of errors can be returned here because maybe we can ignore some of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Thomasdezeeuw not much, seems it can return any NTSTATUS. The only I was able to found:
- some of these unit tests check result of
NtCancelIoFileEx
https://git.reactos.org/?p=reactos.git;a=blob;hb=6d0c07c44fae0a93c57f8d3410545e0f3c201287;f=modules/rostests/winetests/ntdll/pipe.c#l384 - Windows list of
NTSTATUS
codes https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always great when you're developing against an API for which you don't have docs, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rhetorical question I guess :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. I'd like some of these comments addressed, but should be a 👍 afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry missed something in my first review.
I've done a change in the logic of
I've also found another issue we need to address: |
@dtacalau I still need to familiarize more with the Windows impl, but could |
@dtacalau Also I would appreciate it for changes in general if you can not force push commits 🙂. It makes it difficult to review PRs. I like to be able to leave a review, and then when a review is re-requested I can see what changed since the last time. When a force push happens, the "viewed already" cache resets and I don't have a way to tell what is new and what I've reviewed. I wouldn't worry about the git log either because commits should be squashed in a PR. |
@kleimkuhler Yeah that would work, By changing
|
Ok, got it, sorry for that. |
@dtacalau Yea so we still want to call
Edit: That way, we aren't locking it multiple times |
…error, instead keep the err sock states and just retry them later Signed-off-by: Daniel Tacalau <dst4096@gmail.com>
rebased on master @kleimkuhler I'm not quite happy with the solution from #1215 (comment). It works but it feels like a hack I'm going to leave it as it is until I figure something cleaner. WDYT? |
Thanks @dtacalau, sorry for the late review. |
…nstead keep the err sock states and just retry them later.
This is a partial fix for 0.7 because it just handles the errors, and makes the sockstates available next poll instead of panicking. Pushing the error to user is more complicated as it would require new api added. I'd suggest to leave this part until custom IOCP handlers are implemented and #1195 is merged.