Skip to content

Commit

Permalink
don't kill if pid same as file (#8997)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewijw committed May 1, 2024
1 parent 5386e3e commit 6741812
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions celery/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def remove_if_stale(self):
if not pid:
self.remove()
return True
if pid == os.getpid():
# this can be common in k8s pod with PID of 1 - don't kill
return True

Check warning on line 191 in celery/platforms.py

View check run for this annotation

Codecov / codecov/patch

celery/platforms.py#L191

Added line #L191 was not covered by tests

try:
os.kill(pid, 0)
Expand Down

0 comments on commit 6741812

Please sign in to comment.