Skip to content

Commit d557d8d

Browse files
committed
Add a grace period for worker clean-up after prism sending out shutdown signal.
1 parent b4e4140 commit d557d8d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sdks/go/pkg/beam/runners/prism/internal/environments.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ func externalEnvironment(ctx context.Context, ep *pipepb.ExternalPayload, wk *wo
163163
pool.StopWorker(bgContext, &fnpb.StopWorkerRequest{
164164
WorkerId: wk.ID,
165165
})
166+
// Allow a brief grace period for the SDK worker to cleanly shut down its client gRPC channels
167+
// before tearing down the server-side gRPC streams.
168+
time.Sleep(1 * time.Second)
166169
wk.Stop()
167170
}
168171

0 commit comments

Comments
 (0)