> ... didn't know that the mailing list doesn't support images. No problem.
> Yes, this is the place. Even if the thread is interrupted, it will continue the execution. In this case, it will run the finailly-block as usual. So, it seems okay. It will be a problem if the following two lines throw an exception. However, it seems impossible. If it really happens, the exception such as NPE should not be unnoticed. final RaftRpcRequestProto request = r.getServerRequest(); final TermIndex previous = r.hasPreviousLog()? Tsz-Wo On Sat, Sep 28, 2024 at 8:16 AM ka yuu <[email protected]> wrote: > Umm. I'm sorry, I didn't know that the mailing list doesn't support images. > Yes, this is the place > > Tsz Wo Sze <[email protected]> 于2024年9月28日周六 23:08写道: > > > Hi, > > > > The screenshot did not come through. The mailing lists may not allow > > attaching images. > > > > Are you talking about the code below? > > > > public CompletableFuture<AppendEntriesReplyProto> appendEntriesAsync( > > ReferenceCountedObject<AppendEntriesRequestProto> requestRef) > throws > > IOException { > > final AppendEntriesRequestProto r = requestRef.retain(); > > final RaftRpcRequestProto request = r.getServerRequest(); > > final TermIndex previous = r.hasPreviousLog()? > > TermIndex.valueOf(r.getPreviousLog()) : null; > > try { > > ... > > } catch(Exception t) { > > ... > > } finally { > > requestRef.release(); > > } > > > > Tsz-Wo > > > > On Sat, Sep 28, 2024 at 7:53 AM ka yuu <[email protected]> wrote: > > > > > Hi, ratis community! > > > > > > I found that this location seems to cause refCount leaks. > > > > > > > > > 1. Successfully called requestRef.retain () > > > > > > > > > 2. The appendEntriesAsync thread was interrupted by raftServer > before > > > entering the try-finally block > > > > > > > > > > > > [image: Screenshot 2024-09-28 at 22.44.55.png] > > > > > > If this happens, will it cause the unit test to fail? > > > > > >
