You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Mukul Kumar Singh (JIRA)" <ji...@apache.org> on 2018/01/16 06:44:00 UTC

[jira] [Updated] (RATIS-193) RaftClientProtocolService can close a stream twice on error

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

Mukul Kumar Singh updated RATIS-193:
------------------------------------
    Attachment: RATIS-193.001.patch

> RaftClientProtocolService can close a stream twice on error
> -----------------------------------------------------------
>
>                 Key: RATIS-193
>                 URL: https://issues.apache.org/jira/browse/RATIS-193
>             Project: Ratis
>          Issue Type: Bug
>            Reporter: Mukul Kumar Singh
>            Assignee: Mukul Kumar Singh
>            Priority: Major
>         Attachments: RATIS-193.001.patch
>
>
> In case of errors in RaftClientProtocolService.java, on error {{responseObserver.onError(RaftGrpcUtil.wrapException(t));}} will be called which will close the stream observer. This can lead into a case where stream in closed twice in cases of errors. A check similar to RAITS-189 should be added as well.
>  
> {code:java}
> 2018-01-16 11:57:09,810 [grpc-default-executor-3] WARN  client.RaftClientProtocolService (RaftClientProtocolService.java:responseError(186)) - 127.0.0.1_54322-16: Failed processClientRequestAsync for RaftClientRequest(client-8764D94435EE->127.0.0.1_54322) in group-7347726F7570, cid=4, seq=0 RW, 08011224613033313231...(size=291)
> org.apache.ratis.protocol.LeaderNotReadyException: 127.0.0.1_54322 is in LEADER state but not ready yet.
>         at org.apache.ratis.server.impl.RaftServerImpl.checkLeaderState(RaftServerImpl.java:377)
>         at org.apache.ratis.server.impl.RaftServerImpl.submitClientRequestAsync(RaftServerImpl.java:454)
>         at org.apache.ratis.server.impl.RaftServerProxy.submitClientRequestAsync(RaftServerProxy.java:147)
>         at org.apache.ratis.grpc.client.RaftClientProtocolService$AppendRequestStreamObserver.processClientRequestAsync(RaftClientProtocolService.java:125)
>         at org.apache.ratis.util.SlidingWindow$Server.processRequestsFromHead(SlidingWindow.java:351)
>         at org.apache.ratis.util.SlidingWindow$Server.receivedRequest(SlidingWindow.java:343)
>         at org.apache.ratis.grpc.client.RaftClientProtocolService$AppendRequestStreamObserver.onNext(RaftClientProtocolService.java:145)
>         at org.apache.ratis.grpc.client.RaftClientProtocolService$AppendRequestStreamObserver.onNext(RaftClientProtocolService.java:109)
>         at org.apache.ratis.shaded.io.grpc.stub.ServerCalls$2$1.onMessage(ServerCalls.java:206)
>         at org.apache.ratis.shaded.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messageRead(ServerCallImpl.java:237)
>         at org.apache.ratis.shaded.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1.runInContext(ServerImpl.java:485)
>         at org.apache.ratis.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
>         at org.apache.ratis.shaded.io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:154)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> Jan 16, 2018 11:57:09 AM org.apache.ratis.shaded.io.grpc.internal.SerializingExecutor$TaskRunner run
> {code}
> stream is closed again here
> {code}
> SEVERE: Exception while executing runnable org.apache.ratis.shaded.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$2@7edacaf
> java.lang.IllegalStateException: call already closed
>         at org.apache.ratis.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:174)
>         at org.apache.ratis.shaded.io.grpc.internal.ServerCallImpl.close(ServerCallImpl.java:178)
>         at org.apache.ratis.shaded.io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.onCompleted(ServerCalls.java:304)
>         at org.apache.ratis.grpc.client.RaftClientProtocolService$AppendRequestStreamObserver.close(RaftClientProtocolService.java:179)
>         at org.apache.ratis.grpc.client.RaftClientProtocolService$AppendRequestStreamObserver.onCompleted(RaftClientProtocolService.java:172)
>         at org.apache.ratis.shaded.io.grpc.stub.ServerCalls$2$1.onHalfClose(ServerCalls.java:217)
>         at org.apache.ratis.shaded.io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:260)
>         at org.apache.ratis.shaded.io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$2.runInContext(ServerImpl.java:503)
>         at org.apache.ratis.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
>         at org.apache.ratis.shaded.io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:154)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)