AydarZaynutdinov commented on a change in pull request #16109:
URL: https://github.com/apache/beam/pull/16109#discussion_r763076182



##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -69,7 +77,15 @@ func Process(ctx context.Context, cacheService cache.Cache, 
lc *fs_tool.LifeCycl
        validateFunc := executor.Validate()
        go validateFunc(successChannel, errorChannel)
 
-       if err = processStep(ctxWithTimeout, pipelineId, cacheService, 
cancelChannel, successChannel, nil, nil, errorChannel, 
pb.Status_STATUS_VALIDATION_ERROR, pb.Status_STATUS_PREPARING); err != nil {
+       ok, err := processStep(ctxWithTimeout, pipelineId, cacheService, 
cancelChannel, successChannel)
+       if err != nil {
+               return
+       }
+       if !ok {
+               _ = processError(ctxWithTimeout, errorChannel, pipelineId, 
cacheService, "Validate", pb.Status_STATUS_VALIDATION_ERROR)
+               return
+       }

Review comment:
       Here `err` is an error after timeout or cancelation (in that case 
`cmd.Run()` doesn't finish completely).
   If `err` is `nil` it means that `cmd.Run()` finishes completely.
   
   In case of `cmd.Run()` finishes and it doesn't have any error (there is no 
any typos into the code for example) then `ok` is `true` and we need to call 
`processSuccess()` method. However if code contains some typos then 
`compileCmd.Run()` will return `err` and write error description to 
`compileCmd.stdErr`. In that case `ok` is `false` and we need to call 
`processError()` method.




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