awelless commented on code in PR #10088:
URL: https://github.com/apache/nifi/pull/10088#discussion_r2204977338
##########
nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/test/java/org/apache/nifi/processors/aws/kinesis/stream/pause/TestStandardRecordProcessorBlocker.java:
##########
@@ -181,11 +183,16 @@ public void awaitBlockExited() {
}
private void busyWait(final Supplier<Boolean> condition) {
- final long maxWait = System.currentTimeMillis() + 1000;
+ final long maxWait = System.currentTimeMillis() +
BUSY_WAIT_MAX_DURATION.toMillis();
do {
if (System.currentTimeMillis() > maxWait) {
throw new RuntimeException("Timed out waiting for
condition");
}
+ try {
+ Thread.sleep(10L); // Sleep to avoid busy waiting too
aggressively
Review Comment:
Nit: instead of busy waiting we can use `wait-notify` or, perhaps
`java.util.concurrent.locks.Condition`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]