I wrote Java code that connects to Redis and performs operations. When I shut down the Redis server, the thread throws an error but doesn't terminate. It's in TIMED_WAITING status, and the thread waits indefinitely. What should I do to ensure the thread doesn't wait indefinitely for the server response? I want it to simply finish its work.
I tried adding a timeout in the Jedis constructor, but it didn't work. The threads were still running.