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



##########
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:
       In what cases could `err` be `nil` and `ok` be `false`?

##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -78,7 +94,15 @@ func Process(ctx context.Context, cacheService cache.Cache, 
lc *fs_tool.LifeCycl
        prepareFunc := executor.Prepare()
        go prepareFunc(successChannel, errorChannel)
 
-       if err = processStep(ctxWithTimeout, pipelineId, cacheService, 
cancelChannel, successChannel, nil, nil, errorChannel, 
pb.Status_STATUS_PREPARATION_ERROR, pb.Status_STATUS_COMPILING); err != nil {
+       ok, err = processStep(ctxWithTimeout, pipelineId, cacheService, 
cancelChannel, successChannel)

Review comment:
       can you add some comments before each process step function so readers 
know which step is being processed?




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