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` (so it
should be background context). 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]