tvalentyn commented on code in PR #38853:
URL: https://github.com/apache/beam/pull/38853#discussion_r3392152920
##########
sdks/python/container/boot.go:
##########
@@ -333,12 +347,68 @@ func launchSDKProcess() error {
childPids.mu.Unlock()
return
}
- logger.Printf(ctx, "Executing Python (worker
%v): python %v", workerId, strings.Join(args, " "))
- cmd :=
StartCommandEnv(map[string]string{"WORKER_ID": workerId}, os.Stdin, bufLogger,
bufLogger, "python", args...)
+
+ currentProg := "python"
+ currentArgs := []string{"-m",
sdkHarnessEntrypoint}
+ currentEnv := map[string]string{"WORKER_ID":
workerId}
+
+ profilingActive := false
+ currentProg, currentArgs, currentEnv,
profilingActive = maybeWithProfiler(
+ ctx, logger, workerId, currentProg,
currentArgs, currentEnv,
+ )
+
+ var envStr string
+ if len(currentEnv) > 0 {
+ var envStrings []string
+ for k, v := range currentEnv {
+ envStrings = append(envStrings,
k+"="+v)
+ }
+ slices.Sort(envStrings)
+ envStr = strings.Join(envStrings, ", ")
+ }
+
+ logger.Printf(ctx, "Executing Python (%v): %v
%v", envStr, currentProg, strings.Join(currentArgs, " "))
+ cmd := StartCommandEnv(currentEnv, os.Stdin,
bufLogger, bufLogger, currentProg, currentArgs...)
childPids.v = append(childPids.v,
cmd.Process.Pid)
childPids.mu.Unlock()
- if err := cmd.Wait(); err != nil {
+ var timer *time.Timer
+ var profilingTimedOut atomic.Bool
Review Comment:
I believe the ai review flagged this to me out of concern that the timer
coroutine modifies the value concurrently.
--
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]