phoerious commented on a change in pull request #16658:
URL: https://github.com/apache/beam/pull/16658#discussion_r795770738



##########
File path: sdks/python/container/boot.go
##########
@@ -172,12 +186,12 @@ func main() {
                }
        }
 
-       workerPoolId := os.Getenv(workerPoolIdEnv)
        if workerPoolId != "" {
-               multiProcessExactlyOnce(materializeArtifactsFunc, 
"beam.install.complete."+workerPoolId)
+               defer multiProcessExactlyOnce(materializeArtifactsFunc, 
"beam.install.complete." + workerPoolId)()
        } else {
                materializeArtifactsFunc()
        }
+       defer os.RemoveAll(venvDir)

Review comment:
       On the other hand, the code has never been safe against that scenario. 
`multiProcessExactlyOnce()` uses a mutex for running `actionFunc()`, which is 
only safe for child processes that share the same process memory. Since the 
entry point is called via Popen, this never happens anyway. So I am at a total 
loss what `multiProcessExactlyOnce()` is suppose to do in the first place.




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