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

Add SIGTERM handling to segment gatherer #156

Merged
merged 4 commits into from
Nov 13, 2024

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Nov 11, 2024

This PR adds SIGTERM handling to segment gatherer.

After receiving the signal, the gatherer will wait until all active collections have been finished and then exit the program.

@pnuu pnuu requested a review from mraspaud November 11, 2024 10:58
@pnuu pnuu self-assigned this Nov 11, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 14 lines in your changes missing coverage. Please review.

Project coverage is 91.82%. Comparing base (80956c4) to head (3409378).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
pytroll_collectors/segments.py 35.71% 9 Missing ⚠️
pytroll_collectors/tests/test_segments.py 85.71% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   91.23%   91.82%   +0.59%     
==========================================
  Files          32       28       -4     
  Lines        4417     3953     -464     
==========================================
- Hits         4030     3630     -400     
+ Misses        387      323      -64     
Flag Coverage Δ
unittests 91.82% <71.42%> (+0.59%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@coveralls
Copy link

coveralls commented Nov 12, 2024

Pull Request Test Coverage Report for Build 11815651515

Details

  • 35 of 49 (71.43%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+91.0%) to 91.035%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pytroll_collectors/tests/test_segments.py 30 35 85.71%
pytroll_collectors/segments.py 5 14 35.71%
Totals Coverage Status
Change from base Build 7932120988: 91.0%
Covered Lines: 4062
Relevant Lines: 4462

💛 - Coveralls

Copy link
Member

@mraspaud mraspaud 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, just one styling comment.

Comment on lines 720 to 721
if self._sigterm_caught and not self.slots:
self.stop()
Copy link
Member

Choose a reason for hiding this comment

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

How about we put this in the while statement also, and then the stop after the loop? (and probably use break after the keyboard interrupt).

Copy link
Member Author

Choose a reason for hiding this comment

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

Adjusted in 3409378

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

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

LGTM!

@mraspaud mraspaud merged commit f032ca1 into pytroll:main Nov 13, 2024
7 of 8 checks passed
@pnuu pnuu deleted the feature-sigterm-segment-gatherer branch November 13, 2024 10:50
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.

4 participants