[ https://issues.apache.org/jira/browse/RATIS-885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
runzhiwang updated RATIS-885: ----------------------------- Summary: Failed UT because error use of attemptRepeatedly to check boolean condition (was: Error use of attemptRepeatedly to check boolean condition) > Failed UT because error use of attemptRepeatedly to check boolean condition > --------------------------------------------------------------------------- > > Key: RATIS-885 > URL: https://issues.apache.org/jira/browse/RATIS-885 > Project: Ratis > Issue Type: Bug > Reporter: runzhiwang > Assignee: runzhiwang > Priority: Major > Attachments: RATIS-885.001.patch, screenshot-1.png, screenshot-2.png > > > *What's the problem ?* > !screenshot-1.png! > *What's the reason ?* > I think the author of following code want to try 10 seconds until > followerState.getLastAppliedIndex() >= leaderLastIndex, but actually > JavaUtils.attemptRepeatedly will not retry unless the statement throw > exception as the image shows. > {code:java} > // make sure the restarted follower can catchup > final ServerState followerState = > cluster.getRaftServerImpl(followerId).getState(); > JavaUtils.attemptRepeatedly(() -> followerState.getLastAppliedIndex() >= > leaderLastIndex, > 10, ONE_SECOND, "follower catchup", LOG); > {code} > !screenshot-2.png! > *How to fix ?* > I fix all the error use of JavaUtils.attemptRepeatedly to check boolean > condition. -- This message was sent by Atlassian Jira (v8.3.4#803005)