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-8554. Thread pool size needs to be decreased in different order in ReplicationSupervisor #4669

Merged
merged 2 commits into from May 6, 2023

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

tpe.setMaximumPoolSize(threadCount);
tpe.setCorePoolSize(threadCount);

The above code works when increasing thread pool size, but fails when decreasing it, because maximum cannot be set to less than core. Seen in TestDecommissionAndMaintenance logs:

java.lang.IllegalArgumentException
	at java.util.concurrent.ThreadPoolExecutor.setMaximumPoolSize(ThreadPoolExecutor.java:1680)
	at org.apache.hadoop.ozone.container.replication.ReplicationSupervisor$Builder.lambda$build$1(ReplicationSupervisor.java:164)
	at org.apache.hadoop.ozone.container.replication.ReplicationSupervisor.nodeStateUpdated(ReplicationSupervisor.java:294)

Core pool size needs to be decreased first to satisfy preconditions.

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

How was this patch tested?

Added unit test. TestDecommissionAndMaintenance no longer logs this error.

@adoroszlai adoroszlai self-assigned this May 5, 2023
Copy link
Contributor

@sodonnel sodonnel left a comment

Choose a reason for hiding this comment

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

LGTM - Good to see the decommission tests caught this, but bad the decommission tests are flaky so we don't trust them!

@adoroszlai adoroszlai merged commit 2feb738 into apache:master May 6, 2023
27 checks passed
@adoroszlai adoroszlai deleted the HDDS-8554 branch May 6, 2023 07:14
@adoroszlai
Copy link
Contributor Author

Thanks @sodonnel for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants