You probably want to use CallOptions.withWaitForReady() so that the call queues until the transport becomes available.
On Thu, Aug 25, 2016 at 1:54 PM, Ivan Vaskevych <[email protected]> wrote: > Yes, I can reuse the Channel. But I do so from the onError of my > StreamObserver and it creates a new instance of self (StreamObserver). > That also creates excessive logging due to constant (onError -> try to > connect) cycles. > > Is there a better way to do it? > > Thanks! > > On Thu, Aug 25, 2016 at 7:24 PM, Louis Ryan <[email protected]> wrote: > >> Inf-flight streams do not survive server disconnects. The Channel you >> created on the client will attempt to reconnect so can so you can re-start >> your call >> >> On Thu, Aug 25, 2016 at 4:05 AM, Ivan Vaskevych <[email protected] >> > wrote: >> >>> Hi, >>> >>> How do I use client-side backoff reconnect correctly? >>> >>> Scenario: client-side streaming, plainText. When I stop the server I get >>> the error below. >>> After server restart, client doesn't reconnect. That makes sense since I >>> get onError on my StreamObserver. >>> >>> *What should I do* on client side, recreate a channel? >>> >>> >>> client-side error logged from onError: >>> io.grpc.StatusRuntimeException: INTERNAL: Connection closed with >>> unknown cause >>> at io.grpc.Status.asRuntimeException(Status.java:545) >>> at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter >>> .onClose(ClientCalls.java:395) >>> at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.clo >>> se(ClientCallImpl.java:481) >>> at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.acc >>> ess$600(ClientCallImpl.java:398) >>> at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1St >>> reamClosed.runInContext(ClientCallImpl.java:513) >>> at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52) >>> at io.grpc.internal.SerializingExecutor$TaskRunner.run(Serializ >>> ingExecutor.java:154) >>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool >>> Executor.java:1142) >>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo >>> lExecutor.java:617) >>> at java.lang.Thread.run(Thread.java:745) >>> >>> Thanks! >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "grpc.io" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/grpc-io/24389235-a9ff-47c4-8987-f1d205d09364%40googlegroups.com >>> <https://groups.google.com/d/msgid/grpc-io/24389235-a9ff-47c4-8987-f1d205d09364%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> > > > -- > Best Regards, > Ivan > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CADQ0XY02%3DcWd5t6mGdJ8L%3D6S%3Dam3FWwexhc5dHGESsmieiz-mA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
