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 supposed to do in the first place.
Yes, it will prevent artifact redeployment by future processes, but the mutex
within that function is totally useless, so in theory multiple processes could
do the deployment at the same time.
--
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]