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

Correctly return from selector loop one a scheduled task is ready for pr... #2627

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

...ocessing

Motivation:

We use the nanoTime of the scheduledTasks to calculate the milli-seconds to wait for a select operation to select something. Once these elapsed we check if there was something selected or some task is ready for processing. Unfortunally we not take into account scheduled tasks here so the selection loop will continue if only scheduled tasks are ready for processing. This will delay the execution of these tasks.

Modification:

  • Check if a scheduled task is ready after selecting
  • also make a tiny change in NioEventLoop to not trigger a rebuild if nothing was selected because the timeout was reached a few times in a row.

Result:

Execute scheduled tasks on time.

… processing

Motivation:

We use the nanoTime of the scheduledTasks to calculate the milli-seconds to wait for a select operation to select something. Once these elapsed we check if there was something selected or some task is ready for processing. Unfortunally we not take into account scheduled tasks here so the selection loop will continue if only scheduled tasks are ready for processing. This will delay the execution of these tasks.

Modification:

- Check if a scheduled task is ready after selecting
- also make a tiny change in NioEventLoop to not trigger a rebuild if nothing was selected because the timeout was reached a few times in a row.

Result:

Execute scheduled tasks on time.
@normanmaurer
Copy link
Member Author

@trustin please review

@ghost
Copy link

ghost commented Jul 2, 2014

Build result for #2627 at d224e31: Success

@trustin
Copy link
Member

trustin commented Jul 2, 2014

LGTM. Please merge.

@normanmaurer normanmaurer added this to the 4.0.22.Final milestone Jul 2, 2014
@trustin trustin modified the milestone: 4.0.22.Final Jul 2, 2014
@trustin trustin added the defect label Jul 2, 2014
@trustin trustin assigned trustin and normanmaurer and unassigned trustin Jul 2, 2014
@normanmaurer
Copy link
Member Author

@trustin thanks.. cherry-picked into 4.0, 4.1 and master

@normanmaurer normanmaurer deleted the selector_scheduled_tasks branch July 2, 2014 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants