Skip to content

Conversation

AlexeyKuznetsov-DD
Copy link
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Sep 4, 2025

What Does This Do

Adds a maximum 10-second timeout for the Redis client shutdown.
Previously, this test had a high chance of freezing on CI.
After multiple retries, I collected a thread dump from a hung test:

"Test worker" #1 [10060] prio=5 os_prio=0 cpu=7203.66ms elapsed=421.50s tid=0x00007fecf0031970 nid=10060 in Object.wait()  [0x00007fecf764c000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait0([email protected]/Native Method)
	- waiting on <no object reference available>
	at java.lang.Object.wait([email protected]/Object.java:366)
	at java.lang.Object.wait([email protected]/Object.java:339)
	at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:254)
	- locked <0x00000000d816e6f8> (a io.netty.util.concurrent.DefaultPromise)
	at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:32)
	at io.netty.util.concurrent.AbstractFuture.get(AbstractFuture.java:31)
	at com.lambdaworks.redis.AbstractRedisClient.shutdown(AbstractRedisClient.java:277)
	at com.lambdaworks.redis.AbstractRedisClient.shutdown(AbstractRedisClient.java:225)
	at com.lambdaworks.redis.AbstractRedisClient$shutdown.call(Unknown Source)
	at Lettuce4ClientTestBase.cleanup(Lettuce4ClientTestBase.groovy:83)

The freeze was traced to line 83:

redisClient.shutdown()

To prevent indefinite blocking, I refactored it to enforce shutdown with a timeout:

    try {
      redisClient.shutdown(5, 10, TimeUnit.SECONDS)
    } catch (Throwable ignored) {
      // No-op.
    }

Motivation

Improve CI stability by preventing test freezes.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Sep 4, 2025
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added comp: testing Testing tag: no release notes Changes to exclude from release notes labels Sep 4, 2025
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD marked this pull request as ready for review September 4, 2025 22:53
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD requested a review from a team as a code owner September 4, 2025 22:53
Copy link
Contributor

@ygree ygree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD merged commit 21a18ab into master Sep 5, 2025
509 checks passed
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD deleted the alexeyk/lettuce-freeze-fix branch September 5, 2025 12:05
@github-actions github-actions bot added this to the 1.54.0 milestone Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: testing Testing tag: no release notes Changes to exclude from release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants