shunping commented on PR #36235:
URL: https://github.com/apache/beam/pull/36235#issuecomment-3322069080

   > Seems reasonable. Have you run this 100x with the race detector on and off 
to ensure it's deflaked?
   
   Yes I tried the fix 1000x with the race detector and do not see any failure.
   
    
   > Alternatively (or simultaneously), there's a gap we discussed offline 
about how the job.sendState function works. If we have it return the "decided" 
state, some of the other checks would be less racy as well.
   
   If we change job.sendState to return a state after processing through a 
state machine, then a lot of apis in job.go, such as the following, would need 
changing to returning the state. Is that right?
   
   ```
   func (j *Job) Start() {
        j.sendState(jobpb.JobState_STARTING)
   }
   
   // Running indicates that the job is executing.
   func (j *Job) Running() {
        j.sendState(jobpb.JobState_RUNNING)
   }
   
   // Done indicates that the job completed successfully.
   func (j *Job) Done() {
        j.sendState(jobpb.JobState_DONE)
   }
   
   // Canceling indicates that the job is canceling.
   func (j *Job) Canceling() {
        j.sendState(jobpb.JobState_CANCELLING)
   }
   ```
   


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