phoerious commented on code in PR #16658:
URL: https://github.com/apache/beam/pull/16658#discussion_r1016296929
##########
sdks/python/container/boot.go:
##########
@@ -137,46 +145,49 @@ func main() {
options, err := provision.ProtoToJSON(info.GetPipelineOptions())
if err != nil {
- log.Fatalf("Failed to convert pipeline options: %v", err)
+ return fmt.Errorf("Failed to convert pipeline options: %v", err)
}
// (2) Retrieve and install the staged packages.
//
- // Guard from concurrent artifact retrieval and installation,
- // when called by child processes in a worker pool.
+ // No log.Fatalf() from here on, otherwise deferred cleanups will not
be called!
Review Comment:
Same as above. In addition, I don't really like having two different ways to
end the execution of a function, but I changed all the returns to log.Fatalf()
before that point.
##########
sdks/python/container/boot.go:
##########
@@ -73,13 +74,20 @@ const (
)
func main() {
+ if err := mainError(); err != nil {
+ log.Print(err)
+ os.Exit(1)
+ }
+}
+
+func mainError() error {
flag.Parse()
Review Comment:
Done.
##########
sdks/python/container/boot.go:
##########
@@ -73,13 +74,20 @@ const (
)
func main() {
+ if err := mainError(); err != nil {
+ log.Print(err)
+ os.Exit(1)
+ }
+}
+
+func mainError() error {
Review Comment:
Done.
--
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]