You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "damondouglas (via GitHub)" <gi...@apache.org> on 2024/05/02 16:45:21 UTC

Re: [PR] [Prism] Connect Web UI cancel requests with backend [beam]

damondouglas commented on code in PR #31028:
URL: https://github.com/apache/beam/pull/31028#discussion_r1587961096


##########
sdks/go/pkg/beam/runners/prism/internal/jobservices/management.go:
##########
@@ -243,8 +243,8 @@ func (s *Server) Run(ctx context.Context, req *jobpb.RunJobRequest) (*jobpb.RunJ
 // Otherwise, returns nil if Job does not exist or the Job's existing state as part of the CancelJobResponse.
 func (s *Server) Cancel(_ context.Context, req *jobpb.CancelJobRequest) (*jobpb.CancelJobResponse, error) {
 	s.mu.Lock()
+	defer s.mu.Unlock()

Review Comment:
   Now it makes sense to me that state is an atomic.Value and thus I didn't need to put a lock on the whole service. I only lock/unlock when acquiring the Job just like all the other methods.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org