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

[prism] Fail jobs on SDK disconnect. #28193

Merged
merged 5 commits into from
Sep 1, 2023
Merged

[prism] Fail jobs on SDK disconnect. #28193

merged 5 commits into from
Sep 1, 2023

Conversation

lostluck
Copy link
Contributor

@lostluck lostluck commented Aug 29, 2023

If the control connection for a job is lost, eg. by an SDK worker crash (detected via grpc stream context cancel), then fail all extant instructions, and terminate the job, rather than leave it running perpetually.

Further, ensure the extant bundles are cleaned up from the element manager, to allow failed jobs to be properly garbage collected.

Reduce routine log messages to debug to avoid noise.

Use ctx.WithCancelCause properly, which requires calling context.Cause on the context.

Restructures the bundle processing loop in execute.go to better allow for eager bundle splitting. Would need to move bundle data acquisition to be moved out of stage.Execute, and split there.

Special thanks to the Swift SDK for being in a crashing on worker state to reliably validate this.

Related #28187


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

  • 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 or the workflows README to see a list of phrases to trigger workflows.

@github-actions
Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@lostluck
Copy link
Contributor Author

Looks like there's a flake with this approach.

@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Merging #28193 (ceb39d8) into master (a472d1a) will decrease coverage by 0.03%.
The diff coverage is 46.28%.

@@            Coverage Diff             @@
##           master   #28193      +/-   ##
==========================================
- Coverage   72.37%   72.34%   -0.03%     
==========================================
  Files         680      680              
  Lines      100180   100235      +55     
==========================================
+ Hits        72506    72520      +14     
- Misses      26105    26140      +35     
- Partials     1569     1575       +6     
Flag Coverage Δ
go 53.58% <46.28%> (-0.05%) ⬇️

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

Files Changed Coverage Δ
...m/runners/prism/internal/jobservices/management.go 54.97% <0.00%> (ø)
...o/pkg/beam/runners/prism/internal/worker/bundle.go 43.33% <10.00%> (-1.38%) ⬇️
...o/pkg/beam/runners/prism/internal/worker/worker.go 45.21% <21.15%> (-3.35%) ⬇️
...am/runners/prism/internal/engine/elementmanager.go 79.45% <27.27%> (-1.47%) ⬇️
sdks/go/pkg/beam/runners/prism/internal/stage.go 82.97% <83.33%> (-0.28%) ⬇️
...pkg/beam/runners/prism/internal/jobservices/job.go 68.25% <87.50%> (+2.15%) ⬆️
sdks/go/pkg/beam/runners/prism/internal/execute.go 87.07% <88.88%> (+1.53%) ⬆️

... and 1 file with indirect coverage changes

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

@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @jrmccluskey for label go.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@lostluck
Copy link
Contributor Author

lostluck commented Sep 1, 2023

R: @riteshghorse

Jack's out for the weekend.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2023

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

Copy link
Contributor

@riteshghorse riteshghorse left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@lostluck lostluck merged commit 3463aa3 into master Sep 1, 2023
@lostluck lostluck deleted the prismDisconnect branch September 1, 2023 20:39
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.

2 participants