Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix minor unreachable code caused by log.Fatal #22618

Merged
merged 3 commits into from
Aug 14, 2022
Merged

fix minor unreachable code caused by log.Fatal #22618

merged 3 commits into from
Aug 14, 2022

Conversation

Abirdcfly
Copy link
Contributor

https://pkg.go.dev/log#Fatalf

Fatalf is equivalent to Printf() followed by a call to os.Exit(1).

see https://go.dev/play/p/iw2MCkHArJZ for example:

package main

import "log"

func main() {
	log.Println("Println will print and not exit")
	log.Fatalf("Fatalf will print and exit")
	log.Println("this line cant reach")
}

/* output:
2009/11/10 23:00:00 Println will print and not exit
2009/11/10 23:00:00 Fatalf will print and exit

Program exited.
*/

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

R: @lostluck
R: @jrmccluskey
(just found that you have recently reviewed the go code)

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
@Abirdcfly
Copy link
Contributor Author

R: @lostluck

@Abirdcfly
Copy link
Contributor Author

R: @jrmccluskey

@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2022

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #22618 (83dd3c5) into master (17fb9c0) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #22618      +/-   ##
==========================================
- Coverage   74.20%   74.20%   -0.01%     
==========================================
  Files         708      710       +2     
  Lines       93462    93547      +85     
==========================================
+ Hits        69355    69414      +59     
- Misses      22832    22856      +24     
- Partials     1275     1277       +2     
Flag Coverage Δ
go 51.54% <ø> (+0.02%) ⬆️
python 83.60% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/python/apache_beam/utils/interactive_utils.py 95.12% <0.00%> (-2.44%) ⬇️
sdks/python/apache_beam/utils/subprocess_server.py 56.54% <0.00%> (-2.20%) ⬇️
sdks/python/apache_beam/internal/metrics/metric.py 93.00% <0.00%> (-1.00%) ⬇️
sdks/python/apache_beam/io/localfilesystem.py 90.97% <0.00%> (-0.76%) ⬇️
...eam/runners/portability/fn_api_runner/execution.py 92.44% <0.00%> (-0.65%) ⬇️
sdks/python/apache_beam/runners/direct/executor.py 96.46% <0.00%> (-0.55%) ⬇️
sdks/python/apache_beam/transforms/combiners.py 93.05% <0.00%> (-0.39%) ⬇️
sdks/python/apache_beam/coders/coders.py 88.00% <0.00%> (-0.35%) ⬇️
...ks/python/apache_beam/runners/worker/sdk_worker.py 88.94% <0.00%> (-0.16%) ⬇️
sdks/python/apache_beam/transforms/util.py 96.06% <0.00%> (-0.16%) ⬇️
... and 16 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up! Just had a couple small comments, then I'd like to merge

sdks/typescript/boot.go Outdated Show resolved Hide resolved
sdks/python/container/boot.go Outdated Show resolved Hide resolved
Abirdcfly and others added 2 commits August 12, 2022 09:56
Co-authored-by: Danny McCormick <dannymccormick@google.com>
Co-authored-by: Danny McCormick <dannymccormick@google.com>
Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for the contribution!

@damccorm damccorm merged commit d3ba73b into apache:master Aug 14, 2022
MarcoRob pushed a commit to MarcoRob/beam that referenced this pull request Sep 5, 2022
* fix minor unreachable code caused by log.Fatal

Signed-off-by: Abirdcfly <fp544037857@gmail.com>

* Apply suggestions from code review

Co-authored-by: Danny McCormick <dannymccormick@google.com>

* Update sdks/python/container/boot.go

Co-authored-by: Danny McCormick <dannymccormick@google.com>

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
Co-authored-by: Danny McCormick <dannymccormick@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants