You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "rich7420 (via GitHub)" <gi...@apache.org> on 2025/11/16 08:12:03 UTC
[PR] HDDS-13936: Replace Thread.sleep with proper waiting mechanism for Container Balancer [ozone]
rich7420 opened a new pull request, #9302:
URL: https://github.com/apache/ozone/pull/9302
## What changes were proposed in this pull request?
This PR removed the TODO comment as it's now completed.
This PR modified `TestContainerBalancerOperations.java` to replace `Thread.sleep(20000)` with `GenericTestUtils.waitFor()`.
## What is the link to the Apache JIRA
Please create an issue in ASF JIRA before opening a pull request, and you need to set the title of the pull
request which starts with the corresponding JIRA issue number. (e.g. HDDS-XXXX. Fix a typo in YYY.)
[HDDS-13936](https://issues.apache.org/jira/browse/HDDS-13936)
## How was this patch tested?
https://github.com/rich7420/ozone/actions/runs/19402653019
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13936. Replace Thread.sleep with waitFor in TestContainerBalancerOperations [ozone]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9302:
URL: https://github.com/apache/ozone/pull/9302#issuecomment-3546189632
Thanks @sarvekshayr , @chungen0126 and @adoroszlai !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13936. Replace Thread.sleep with waitFor in TestContainerBalancerOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #9302:
URL: https://github.com/apache/ozone/pull/9302
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13936. Replace Thread.sleep with waitFor in TestContainerBalancerOperations [ozone]
Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #9302:
URL: https://github.com/apache/ozone/pull/9302#issuecomment-3546150659
Thanks @rich7420 for the patch, @chungen0126, @sarvekshayr for the review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13936. Replace Thread.sleep with proper waiting mechanism for Container Balancer [ozone]
Posted by "sarvekshayr (via GitHub)" <gi...@apache.org>.
sarvekshayr commented on code in PR #9302:
URL: https://github.com/apache/ozone/pull/9302#discussion_r2532764925
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java:
##########
@@ -97,12 +98,17 @@ public void testContainerBalancerCLIOperations() throws Exception {
running = containerBalancerClient.getContainerBalancerStatus();
assertTrue(running);
- // waiting for balance completed.
- // TODO: this is a temporary implementation for now
- // modify this after balancer is fully completed
- try {
- Thread.sleep(20000);
- } catch (InterruptedException e) { }
+ GenericTestUtils.waitFor(
+ () -> {
+ try {
+ return !containerBalancerClient.getContainerBalancerStatus();
+ } catch (IOException e) {
+ return false;
+ }
+ },
+ 100,
+ 30000
+ );
running = containerBalancerClient.getContainerBalancerStatus();
assertFalse(running);
Review Comment:
This check is redundant, `waitFor()` already covers this condition.
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13936. Replace Thread.sleep with proper waiting mechanism for Container Balancer [ozone]
Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #9302:
URL: https://github.com/apache/ozone/pull/9302#issuecomment-3541477582
@sarvekshayr thanks for the feedback!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org