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

HDDS-5355. In ContainerStateMachine, share the executor threads between the containers. #2350

Merged
merged 2 commits into from
Jun 22, 2021

Conversation

szetszwo
Copy link
Contributor

What changes were proposed in this pull request?

//ContainerStateMachine
  private ExecutorService getCommandExecutor(
      ContainerCommandRequestProto requestProto) {
    int executorId = (int)(requestProto.getContainerID() % executors.length);
    return executors[executorId];
  }

In the code above, different containers having the same remainder (mod executors.length ) will use the same executor even if some other executors are idle.  Ideally, different containers should use a different executor if there are executors available.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-5355

How was this patch tested?

Existing unit tests.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @szetszwo for the improvement.

@adoroszlai adoroszlai merged commit 5c3f9aa into apache:master Jun 22, 2021
@szetszwo
Copy link
Contributor Author

Thanks @bshashikant for reviewing this and @adoroszlai for merging this!

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.

3 participants