[ 
https://issues.apache.org/jira/browse/RATIS-885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shashikant Banerjee updated RATIS-885:
--------------------------------------
        Parent: RATIS-863
    Issue Type: Sub-task  (was: Bug)

> 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: Sub-task
>            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)

Reply via email to