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) #9007

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions celery/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def remove_if_stale(self):
return True
if pid == os.getpid():
# this can be common in k8s pod with PID of 1 - don't kill
self.remove()
return True

try:
Expand Down
2 changes: 1 addition & 1 deletion t/unit/utils/test_platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def test_remove_if_stale_same_pid(self):
p.remove = Mock()

assert p.remove_if_stale()
p.remove.assert_not_called()
p.remove.assert_called_with()

@patch('os.fsync')
@patch('os.getpid')
Expand Down