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

Rename EWYK The AdaptiveExecutionStrategy #6353

Merged
merged 21 commits into from Jun 16, 2021

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Jun 3, 2021

Rename EWYK to AdaptiveExecutionStrategy, which better represents the nature of the strategy.
#6391
Signed-off-by: Greg Wilkins gregw@webtide.com

Rename EWYK The AdaptiveExecutionStrategy, which better represents the nature of the strategy.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw requested a review from sbordet June 3, 2021 11:43
Rename EWYK The AdaptiveExecutionStrategy, which better represents the nature of the strategy.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
gregw added 8 commits June 4, 2021 09:18
Updated the documentation from review, but in so doing realised that the
sub-strategy selection could be more simply represented in code, so that was
also updated.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Updated the documentation from review, but in so doing realised that the
sub-strategy selection could be more simply represented in code, so that was
also updated.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Updated the documentation from review, but in so doing realised that the
sub-strategy selection could be more simply represented in code, so that was
also updated.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Added notes about chaining strategies and thread starvation

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Fixed formatting and made a little clearer

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Added deprecated version of EWYK

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@sbordet sbordet added this to In progress in Jetty 10.0.5/11.0.5 FROZEN via automation Jun 4, 2021
lachlan-roberts
lachlan-roberts previously approved these changes Jun 7, 2021
Copy link
Contributor

@lachlan-roberts lachlan-roberts left a comment

Choose a reason for hiding this comment

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

LGTM

Jetty 10.0.5/11.0.5 FROZEN automation moved this from In progress to Review in progress Jun 7, 2021
Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
version without code duplication

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw
Copy link
Contributor Author

gregw commented Jun 9, 2021

@sbordet I have pushed a version without the lock hack that well matches the documented algorithm. Note also with this forumulation there is one less test the common case for a non-blocking task, so it will take a much simpler path.

The cost is that for the case of an potentially blocking task when there are no pending producers available, then the taskType is checked twice. This double check can be removed, but only by breaking out the EITHER and BLOCKING cases and thus duplicating the synchronized block and changing the flow from the documentation... but that may also be OK.... I'll add it as a comment to compare.

@gregw gregw requested a review from sbordet June 9, 2021 22:06
Even more comments
Some duplicated code to avoid double test on taskType

Signed-off-by: Greg Wilkins <gregw@webtide.com>
hide the Runnable interface from the strategy signature

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw linked an issue Jun 10, 2021 that may be closed by this pull request
@gregw gregw removed this from Review in progress in Jetty 10.0.5/11.0.5 FROZEN Jun 10, 2021
@gregw gregw added this to In progress in Jetty 10.0.6/11.0.6 FROZEN via automation Jun 10, 2021
@gregw gregw moved this from In progress to Review in progress in Jetty 10.0.6/11.0.6 FROZEN Jun 10, 2021
@gregw
Copy link
Contributor Author

gregw commented Jun 12, 2021

@sbordet nudge... let's get this merged long before next release train

sbordet
sbordet previously approved these changes Jun 14, 2021
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

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

Looks good apart niggles in the comment/javadocs.

Since many javadocs were added, a general rule for javadocs is that they should be written in 3rd person, therefore "Selects a sub-strategy" rather than "Select a sub-strategy", "Runs" rather than "Run", etc.
See:
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#styleguide
https://blog.joda.org/2012/11/javadoc-coding-standards.html

Jetty 10.0.6/11.0.6 FROZEN automation moved this from Review in progress to Reviewer approved Jun 14, 2021
niggles for javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw dismissed stale reviews from sbordet and lachlan-roberts via 8acfd44 June 14, 2021 23:17
Jetty 10.0.6/11.0.6 FROZEN automation moved this from Reviewer approved to Review in progress Jun 14, 2021
Jetty 10.0.6/11.0.6 FROZEN automation moved this from Review in progress to Reviewer approved Jun 15, 2021
sbordet
sbordet previously approved these changes Jun 15, 2021
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

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

Not all javadocs were put in 3rd person, it's just to have a little more consistency, but I don't want to annoy too much. LGTM.

more niggles for javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw gregw dismissed stale reviews from sbordet and lachlan-roberts via d2dee7b June 15, 2021 12:36
Jetty 10.0.6/11.0.6 FROZEN automation moved this from Reviewer approved to Review in progress Jun 15, 2021
@sbordet sbordet self-requested a review June 15, 2021 14:22
Fixed javadoc 3rd person forms.
Removed stale references to doProduce() method.
Using IO.close(Closeable).
Other small cosmetic changes.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@gregw
Copy link
Contributor Author

gregw commented Jun 15, 2021

@sbordet nudge

@sbordet
Copy link
Contributor

sbordet commented Jun 15, 2021

@gregw I made further changes to the javadocs, see my commit.

Jetty 10.0.6/11.0.6 FROZEN automation moved this from Review in progress to Reviewer approved Jun 15, 2021
* @return True if the sub-strategy requires the caller to continue to produce tasks.
*/
private boolean consumeTask(Runnable task, SubStrategy subStrategy)
{
// Consume and/or execute task according to the selected mode.
if (LOG.isDebugEnabled())
LOG.debug("{} ss={} t={}/{} {}", this, subStrategy, task, Invocable.getInvocationType(task));
LOG.debug("ss={} t={}/{} {}", subStrategy, task, Invocable.getInvocationType(task), this);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sbordet this is now inconsistent with the other debugs in the class.... but I guess that is not so important.

@gregw gregw merged commit a415606 into jetty-10.0.x Jun 16, 2021
Jetty 10.0.6/11.0.6 FROZEN automation moved this from Reviewer approved to Done Jun 16, 2021
@joakime joakime deleted the jetty-10.0.x-AdaptiveExecutionStrategy branch June 17, 2021 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Rename EatWhatYouKill to AdaptiveExecutionStrategy
3 participants