kstyrc / embedded-redis

Redis embedded server for Java integration testing
840 stars 368 forks source link

RedisServer#stop not working properly #81

Open ilya-bystrov opened 7 years ago

ilya-bystrov commented 7 years ago

It looks like that RedisServer#stop method doesn't terminate corresponding threads. And so App doesn't terminates.

Here is Main class code:

    public static void main(String[] args) throws IOException, InterruptedException {
        RedisServer redisServer = new RedisServer();
        System.out.println("starting...");
        redisServer.start();
        Thread.sleep(5000);
        System.out.println("stopping...");
        redisServer.stop();
    }

Version:

        <dependency>
            <groupId>com.github.kstyrc</groupId>
            <artifactId>embedded-redis</artifactId>
            <version>0.6</version>
        </dependency>

JDK:

java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
mattvryan commented 6 years ago

@ilya-bystrov I'm seeing the same problem in my use as well. In my case redisServer.stop() completes and the actual server appears to shut down, as prior to calling stop() I can connect via command-line client but after calling stop() I can no longer connect. But my Java app will not shut down.

@kstyrc / anyone: Any update on this issue?

kentmw commented 5 years ago

Upgrading to the new, currently still managed project fixed this:

    <dependency>
      <groupId>it.ozimov</groupId>
      <artifactId>embedded-redis</artifactId>
      <version>0.7.2</version>
    </dependency>