You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/12/20 19:48:23 UTC

[GitHub] [beam] AydarZaynutdinov commented on a change in pull request #16234: [BEAM-13461][Playground] [Bugfix] Error when try to set status after time-out

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



##########
File path: playground/backend/internal/code_processing/code_processing.go
##########
@@ -352,21 +352,21 @@ func cancelCheck(ctx context.Context, pipelineId uuid.UUID, cancelChannel chan b
 // 	and it waits until the method stops the work to change status to the pb.Status_STATUS_FINISHED. Write last logs
 //	to the cache and set value to the finishReadLogChannel channel to unblock the code processing.
 // In other case each pauseDuration write to cache logs of the code processing.
-func readLogFile(ctx context.Context, cacheService cache.Cache, logFilePath string, pipelineId uuid.UUID, stopReadLogsChannel, finishReadLogChannel chan bool) {
+func readLogFile(ctxWithTimeout, ctx context.Context, cacheService cache.Cache, logFilePath string, pipelineId uuid.UUID, stopReadLogsChannel, finishReadLogChannel chan bool) {

Review comment:
       Not really. `ctxWithTimeout` is the context that represents the pipeline execution, but `ctx` is the parent context of the `ctxWithTimeout`. When `ctxWithTimeout` is done (by the timeout for example), we can't use it to set some value to the cache. However `ctx` is not done and we can use it to set some value to the cache.
   About renaming yes. It is a good idea. I renamed `ctx` and `ctxWithTimeout` and now it should be clearer.




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