From 3dd1c14670c054e481a47f5c20cf82f597d32a5b Mon Sep 17 00:00:00 2001 From: Bharath Date: Wed, 27 Nov 2024 14:22:45 +0530 Subject: [PATCH] close the stream when we get the done signal --- grpc/optimistic/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grpc/optimistic/server.go b/grpc/optimistic/server.go index 041b5d4e4..aef5e9207 100644 --- a/grpc/optimistic/server.go +++ b/grpc/optimistic/server.go @@ -156,6 +156,8 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlockStream(stream optimist return status.Error(codes.DeadlineExceeded, "timed out waiting for mempool to clear after optimistic block execution") case err := <-mempoolClearingEvent.Err(): return status.Errorf(codes.Internal, "error waiting for mempool clearing event: %v", err) + case err := <-stream.Context().Done(): + return status.Errorf(codes.Internal, "stream closed with error: %v", err) } } }