redislite icon indicating copy to clipboard operation
redislite copied to clipboard

Avoid killing oneself if redis gets stuck dieing

Open tyrken opened this issue 1 year ago • 1 comments

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

When running redislite under GitHub Actions in an container (rather than directly on the runner) I see pytest die with exit code 137.

After some debugging I realised it's as GHA runs containers with tail as PID=1 which doesn't process signals correctly, so the daemonized redis-server goes <defunct> aka Zombie when it exits. This sends redislite through a series of timeouts resulting in a final SIGTERM using self.pid which while non-zero at the start becomes zero by the time of the SIGTERM (I assume via some callback action inside the redis library this package extends), leading to a suicide. Switching to use process.pid seems better for this situation & avoids the self-kill.

tyrken avatar Aug 16 '24 09:08 tyrken

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.73%. Comparing base (802f8a0) to head (83ccc7f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
- Coverage   98.75%   98.73%   -0.02%     
==========================================
  Files           5        5              
  Lines         322      317       -5     
  Branches       52       52              
==========================================
- Hits          318      313       -5     
  Partials        4        4              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Aug 16 '24 10:08 codecov-commenter