lostluck commented on code in PR #33438:
URL: https://github.com/apache/beam/pull/33438#discussion_r1899831237
##########
sdks/go/pkg/beam/runners/prism/internal/worker/worker.go:
##########
@@ -151,20 +105,10 @@ func (wk *W) shutdown() {
}
}
-// Stop the GRPC server.
+// Stop the worker and delete it from the Pool.
func (wk *W) Stop() {
wk.shutdown()
-
- // Give the SDK side 5 seconds to gracefully stop, before
- // hard stopping all RPCs.
- tim := time.AfterFunc(5*time.Second, func() {
- wk.server.Stop()
- })
- wk.server.GracefulStop()
- tim.Stop()
-
- wk.lis.Close()
- slog.Debug("stopped", "worker", wk)
+ delete(Pool, wk.ID)
Review Comment:
At minimum, this needs to use the lock before deleting it. Deletes to maps
are writes, and map writes are never concurrency safe with any other operation
on the same map.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]