Giter Club home page Giter Club logo

Comments (3)

DrHyde avatar DrHyde commented on August 12, 2024 1

Thanks. I've tested with both Redis 5 and 6, and both work just fine now.

from test-redisserver.

Songmu avatar Songmu commented on August 12, 2024

Thanks for the report. I have also seen the report to Redis itself and understand the situation.

There are several possible ways to do this.

  1. Try SIGTERM a few times, and if it doesn't work, send SIGKILL.
    • Good: This is a common practice when stopping a daemon process
    • Good: It is relatively easy to implement.
    • Bad: It's a bit rough.
    • Good: However, it will definitely stop the process, not just in this case.
  2. Check for the existence of the directory when stopping, and if it is not found, perform CONFIG SET appendonly no, CONFIG SET save "", and then stop the process (SIGTERM).
    • Good: This is the most correct method for this case.
    • Bad?: It's a good idea to set appendonly as well, but I can't guarantee that it will work on versions earlier than 1.1 that don't support it.
      • However, I don't think we should guarantee that older versions will work.
    • Bad: We need to add more runtime dependencies such as Redis.pm to issue commands to redis.
  3. Don't use CLEANUP => 1 for implicit tmpdir creation in new, delete tmpdir by itself on stop.
    • Good?: Delete tmpdir on stop only if it is not passed to the constructor. In this case, if we explicitly pass a tmpdir with CLEANUP => 1 to the constructor, we may face the same problem as in this issue, but I don't think there are many use cases for that.
      • It's not a good idea to delete tmpdir all together, because sometimes we don't want it to be deleted for exapmle debugging purposes
    • Bad: It's a work-around, and it's tricky to read and understand the code.

Let me think some more about what to do. Your pull requests are also welcome.

from test-redisserver.

Songmu avatar Songmu commented on August 12, 2024

I have implemented the above 2 methods. I was also able to write a test that reproduced the situation, so I was able to solve the problem. ref. #15

from test-redisserver.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.