Skip to content

[Backport 7.x] Allow unknown task time in QueueResizingEsTPE#41957

Merged
williamrandolph merged 1 commit intoelastic:7.xfrom
williamrandolph:allow_unknown_task_time_backport
May 8, 2019
Merged

[Backport 7.x] Allow unknown task time in QueueResizingEsTPE#41957
williamrandolph merged 1 commit intoelastic:7.xfrom
williamrandolph:allow_unknown_task_time_backport

Conversation

@williamrandolph
Copy link
Copy Markdown
Contributor

@williamrandolph williamrandolph commented May 8, 2019

  • Allow unknown task time in QueueResizingEsTPE

The afterExecute method previously asserted that a TimedRunnable task
must have a positive execution time. However, the code in TimedRunnable
returns a value of -1 when a task time is unknown. Here, we expand the
logic in the assertion to allow for that possibility, and we don't
update our task time average if the value is negative.

  • Add a failure flag to TimedRunnable

In order to be sure that a task has an execution time of -1 because of
a failure, I'm adding a failure flag boolean to the TimedRunnable class.
If execution time is negative for some other reason, an assertion will
fail.

Backport of #41810
Fixes #41448

* Allow unknown task time in QueueResizingEsTPE

The afterExecute method previously asserted that a TimedRunnable task
must have a positive execution time. However, the code in TimedRunnable
returns a value of -1 when a task time is unknown. Here, we expand the
logic in the assertion to allow for that possibility, and we don't
update our task time average if the value is negative.

* Add a failure flag to TimedRunnable

In order to be sure that a task has an execution time of -1 because of
a failure, I'm adding a failure flag boolean to the TimedRunnable class.
If execution time is negative for some other reason, an assertion will
fail.

Backport of elastic#41810
Fixes elastic#41448
@williamrandolph williamrandolph merged commit a2b7871 into elastic:7.x May 8, 2019
@williamrandolph williamrandolph deleted the allow_unknown_task_time_backport branch August 21, 2019 14:30
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.

1 participant