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

Optimize single thread work pool running srtrategy #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KazankovMarch
Copy link
Contributor

No description provided.

@KazankovMarch KazankovMarch changed the base branch from master to release/1.9 January 28, 2021 20:30
@@ -15,7 +15,7 @@ private WorkPoolRunningStrategies() {

@NotNull
public static WorkPoolRunningStrategy getSingleThreadStrategy() {
return localWorkPool -> 1;
return localWorkPool -> localWorkPool.isEmpty()? 0 : 1;
Copy link
Member

Choose a reason for hiding this comment

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

Could you please provide test when

  1. we start DJM with single job that has empty work pool
  2. work pool of the job is changed to non-empty
    Expecting:
  • job is not launched, from metrics we see that job did not started and we see that there is empty workpool for it
  • number of threads changed correctly, job is launched, metrics are recorded

That kind of test and metrics will ensure that we can detect reason that job did not started due to empty workPool and also can be sure that 0 number of threads does not kill our scheduller.

Copy link
Member

Choose a reason for hiding this comment

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

threadsCount = Math.max(threadsCount, 1); should save us, but better to have a test case for that.

@swarmshine swarmshine changed the base branch from release/1.9 to master October 8, 2021 14:39
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.

2 participants