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

The Redis Server does not stop upon application crash. #84

Open
ChetanBhasin opened this issue May 9, 2017 · 4 comments
Open

The Redis Server does not stop upon application crash. #84

ChetanBhasin opened this issue May 9, 2017 · 4 comments

Comments

@ChetanBhasin
Copy link

When the application crashes, the Redis server along with it does not stop. So if a test crashes, a person has to manually stop the process by killing it to free up the port.

@dcrn
Copy link

dcrn commented May 11, 2017

This is a problem with my project's unit tests also. We have to manually kill the redis server process after every test failure. (v0.6 on Windows)

@maksymkovalenko
Copy link

Just add a shutdown hook.

Runtime.getRuntime().addShutdownHook(new Thread() {
    public void run() { redis.stop(); }
});

@ValeryIvanov
Copy link

@maksymkovalenko this does not seem to work... could you please add more detailed example? where should this be added? in constructor?

@stephenc
Copy link

So, there is a way this could perhaps be made to work. Instead of launching redis directly, embedded-redis could use a wrapper script to kill redis when the JVM terminates... i.e. a wrapper script that does something like: https://stackoverflow.com/a/4054436/1589700

On the other hand, outside of testing, there could be valid reasons for keeping the process alive... for example if one were using redis to store application state and restarting the JVM to live self-"update" the application, you might be really annoyed if the embedded redis dies with the JVM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants