-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix: Don't restart polling when libuv emits an error #1804
Conversation
This prevents an infinite loop of polling on a bad file handle
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.
This looks great but I want to test it with actual hardware. @HipsterBrown or @fivdi if either of you have any time to test please do.
I am beta testing this fix with my fork and I'm finding that for some cases, the @reconbot any ideas as to why this might happen? It looks like the only option I have left it so force-restart the node process when we detect that serialport gets stuck. |
This change doesn't effect port opening at all. |
@@ -61,10 +61,10 @@ void Poller::onData(uv_poll_t* handle, int status, int events) { | |||
// fprintf(stdout, "OnData status=%d events=%d\n", status, events); | |||
argv[0] = Nan::Null(); | |||
argv[1] = Nan::New<v8::Integer>(events); | |||
// remove triggered events from the poll | |||
int newEvents = obj->events & ~events; | |||
obj->poll(newEvents); |
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.
ok yes this wont update the poll events on an error - but no this wont stop the poller on an error we should try to call uv_poll_stop(poll_handle);
@nfrasser are you able to address the feedback? |
fixed in #1936 |
Fixes #1803
This prevents an infinite loop of polling on a bad file handle