Skip to content

Redis 6 on Mac won't halt on SIGTERM if the temp directory has been deleted #13

@DrHyde

Description

@DrHyde

If you create a Test::RedisServer object which doesn't get destroyed until global destruction, and use the default setting of having T::RS create a temp dir for you, then, because the order of destruction is not guaranteed, the directory object may get destroyed (triggering deletion of the directory) before T::RS sends the SIGTERM signal to redis-server.

Redis-server then doesn't stop, because for some reason it seems to want the directory to exist.

I have a work-around in my code, where I supply a temp dir to the constructor, and then call ...->stop in and END block, thus guaranteeing that T::RS stops redis-server while the directory still exists.

I can't think off the top of my head of a better solution which could be applied inside T::RS itself, except perhaps that of sending a SIGKILL instead, but that's a bit icky.

I've only seen this on MacOS, so it may be a platform-specific quirk of Redis - it's definitely a Redis bug at heart and I have also reported it to them: redis/redis#10330

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions