waneal commented on code in PR #40197:
URL: https://github.com/apache/beam/pull/40197#discussion_r4060483425


##########
sdks/go/pkg/beam/runners/prism/internal/jobservices/server.go:
##########
@@ -73,10 +74,11 @@ func NewServer(port int, execute func(*Job)) *Server {
                panic(fmt.Sprintf("failed to listen: %v", err))
        }
        s := &Server{
-               lis:     lis,
-               jobs:    make(map[string]*Job),
-               execute: execute,
-               logger:  slog.Default(), // TODO substitute with a configured 
logger.
+               lis:       lis,
+               jobs:      make(map[string]*Job),
+               execute:   execute,
+               artifacts: map[string][]byte{},

Review Comment:
   Previously `artifacts` was left nil here and lazily initialized in 
artifact.go right before the first write (`if len(s.artifacts) == 0 {...}`), to 
avoid panicking on a write to a nil map. That lazy check was itself racy, so 
this now initializes eagerly instead.



-- 
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]

Reply via email to