Skip to content

Commit

Permalink
Attempt at fixing a flaky test in Canton (digital-asset#16497)
Browse files Browse the repository at this point in the history
Canton fails because this error appears in the logs:
```
SEVERE: Exception while executing runnable io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed@4e6759b5
java.lang.IllegalStateException: Promise already completed.
	at com.daml.grpc.adapter.utils.BufferingObserver.onError(BufferingObserver.scala:19)
```
  • Loading branch information
pbatko-da authored Mar 9, 2023
1 parent 95dda28 commit 6a235ac
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class BufferingObserver[T](limit: Option[Int] = None) extends StreamObserver[T]
val size = new AtomicInteger(0)
def resultsF = promise.future

override def onError(t: Throwable): Unit = promise.failure(t)
override def onError(t: Throwable): Unit = {
val _ = promise.tryFailure(t)
}

override def onCompleted(): Unit = {
val vec = Vector.newBuilder[T]
Expand Down

0 comments on commit 6a235ac

Please sign in to comment.