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

don't kill if pid same as file (#8997) #8998

Merged
merged 4 commits into from May 5, 2024
Merged

don't kill if pid same as file (#8997) #8998

merged 4 commits into from May 5, 2024

Conversation

lewijw
Copy link
Contributor

@lewijw lewijw commented May 2, 2024

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

When celery runs in a pod in k8s, it runs as PID 1. If it crashes, k8s restarts the process but since the pid file has a 1 in it, it kills itself. With this change, if the pid in the file is the same as the pid of the process, it will not kill the process.

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.81%. Comparing base (e9ebd65) to head (a395954).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8998   +/-   ##
=======================================
  Coverage   77.80%   77.81%           
=======================================
  Files         150      150           
  Lines       18686    18688    +2     
  Branches     3193     3194    +1     
=======================================
+ Hits        14539    14542    +3     
  Misses       3854     3854           
+ Partials      293      292    -1     
Flag Coverage Δ
unittests 77.79% <100.00%> (+<0.01%) ⬆️

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.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

this will need some unit tests to avoid any regression

@auvipy auvipy merged commit 77dbc05 into celery:main May 5, 2024
82 checks passed
@auvipy auvipy added this to the 5.4.x milestone May 5, 2024
@lewijw lewijw deleted the no_kill branch May 6, 2024 17:51
lewijw added a commit to lewijw/celery that referenced this pull request May 6, 2024
auvipy pushed a commit that referenced this pull request May 9, 2024
The pid file needs to be deleted.
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.

None yet

2 participants