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

Enable force stop #22

Closed
wants to merge 6 commits into from
Closed

Conversation

artkonr
Copy link

@artkonr artkonr commented Sep 28, 2022

Hey team,

In our project, we're using embedded Redis instances with fixed ports and we occasionally encounter situations, when the Redis instance is not terminated properly leaving the port busy after the JVM is shut down, forcing us in turn to do kill -9.

With this PR I'd like to introduce a builder flag for standalone, sentinel and cluster that enables force-stopping of the instance by passing a SIGKILL via Process#destroyForcibly() instead a graceful SIGTERM. The new config would be enabled solely on Java side like this:

Redis redis = RedisServer.builder()
    .onShutdownForceStop(true)
    .build();

Apart from this change, I've also taken upon myself the liberty of doing a bit of a clean-up:

  • fixed maven warnings (absent compiler version and use of <prerequisites>)
  • made a few tweaks to the test classes (replacing deprecated Jedis API calls and silencing other non-critical warnings).

All changes introduced go in separate commits, let me know if you want to go with some of them and not accept others or to squash them into bigger change sets.

@codemonstur
Copy link

I like this idea so I built this into my fork of the project.

@nickngn
Copy link

nickngn commented Apr 4, 2023

This fork saves my day!

@artkonr artkonr closed this by deleting the head repository Dec 24, 2024
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

Successfully merging this pull request may close these issues.

3 participants