io.grpc.StatusRuntimeException: CANCELLED: call already cancelled
at io.grpc.Status.asRuntimeException(Status.java:517)
at io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.onNext(ServerCalls.java:335)
at com.trueaccord.scalapb.grpc.Grpc$.completeObserver(Grpc.scala:21)
at beaker.server.protobuf.BeakerGrpc$$anon$8.$anonfun$invoke$7(BeakerGrpc.scala:183)
at beaker.server.protobuf.BeakerGrpc$$anon$8.$anonfun$invoke$7$adapted(BeakerGrpc.scala:183)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:140)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1021)
at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(ForkJoinPool.java:1046)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1058)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)private[beaker] def accept(proposal: Proposal): Future[Unit] = {
val fork = Context.current().fork()
val prev = fork.attach()
val stub = BeakerGrpc.stub(this.channel).withDeadlineAfter(1, TimeUnit.SECONDS)
try {
stub.accept(proposal).filter(_.successful)
} finally {
fork.detach(prev)
}
}
--
You received this message because you are subscribed to the Google Groups "ScalaPB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/beae5012-17e9-41dc-bb86-9559a1910a22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def completeObserver[T](observer: StreamObserver[T])(t: Try[T]): Unit = t match {
case scala.util.Success(value) =>
observer.onNext(value)
observer.onCompleted()
case scala.util.Failure(s: StatusException) =>
observer.onError(s)
case scala.util.Failure(s: StatusRuntimeException) =>
observer.onError(s)
case scala.util.Failure(e) =>
observer.onError(
Status.INTERNAL.withDescription(e.getMessage).withCause(e).asException()
)
}
def completeObserver[T](observer: StreamObserver[T])(t: Try[T]): Unit = t.flatMap(observer.onNext) match {
case scala.util.Success(value) =>
observer.onCompleted()
case scala.util.Failure(s: StatusException) =>
observer.onError(s)
case scala.util.Failure(s: StatusRuntimeException) =>
observer.onError(s)
case scala.util.Failure(e) =>
observer.onError(
Status.INTERNAL.withDescription(e.getMessage).withCause(e).asException()
)
}
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+u...@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/beae5012-17e9-41dc-bb86-9559a1910a22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---Nadav
Would you mind sending a PR? Can you add a test that ensures that onError gets called?If an exception is thrown by an implementation the caller is expected to terminate the stream by calling
onError(Throwable)with the caught exception prior to propagating it.
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/1dd9c95e-25d8-4920-8419-cf0e021375f8%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/1dd9c95e-25d8-4920-8419-cf0e021375f8%40googlegroups.com.
---Nadav
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/d40749e1-50b0-478e-b0f7-8e6355157f88%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/d40749e1-50b0-478e-b0f7-8e6355157f88%40googlegroups.com.
---Nadav
To unsubscribe from this group and stop receiving emails from it, send an email to scalapb+unsubscribe@googlegroups.com.
To post to this group, send email to sca...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/933c60c1-0f8c-41b3-8ee1-e67b5be4ef52%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalapb/933c60c1-0f8c-41b3-8ee1-e67b5be4ef52%40googlegroups.com.
---Nadav