Skip to content
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

watchdog: fix timeout not running if polling returned early #622

Closed
wants to merge 1 commit into from

Conversation

saghul
Copy link
Member

@saghul saghul commented Jan 27, 2015

@@ -75,11 +76,16 @@ void Watchdog::Run(void* arg) {


void Watchdog::Async(uv_async_t* async) {
Watchdog* w = ContainerOf(&Watchdog::async_, async);
// stop the loop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment is a bit superfluous, isn't it? :-)

@bnoordhuis
Copy link
Member

LGTM. Maybe the commit log can go into a little more detail.

Switch from running the loop with UV_RUN_ONCE to UV_RUN_DEFAULT, because
it's possible that the poll returns earlier than expected and thus the
timer is not run on a single interation.

The loop is not stopped either from the timer callback or from the async
handle's.
@saghul
Copy link
Member Author

saghul commented Jan 27, 2015

Fixed, can you PTAL?

@bnoordhuis
Copy link
Member

LGTM. @rvagg?

@rvagg
Copy link
Member

rvagg commented Jan 27, 2015

yes, this is excellent, thanks @saghul

additional context to explain what's going on here for the record libuv/libuv#168

rvagg pushed a commit that referenced this pull request Jan 27, 2015
Switch from running the loop with UV_RUN_ONCE to UV_RUN_DEFAULT, because
it's possible that the poll returns earlier than expected and thus the
timer is not run on a single interation.

The loop is not stopped either from the timer callback or from the async
handle's.

PR-URL: #622
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
@rvagg
Copy link
Member

rvagg commented Jan 27, 2015

landed @ b50fea4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants