Skip to content

Conversation

artembilan
Copy link
Member

The Lettuce client is based on the Netty and more stable, than Jedis
therefore we get a performance improvement for tests
(it saves us at about 30 seconds).
Also this client doesn't fail for me on Windows sporadically (very often)
with the ConnectionClosedException

  • After switching to the Netty-based client, we expose the interrupted
    Thread issue in the LockRegistryLeaderInitiator.
    If we interrupted (expected behavior), we try to unlock calling
    RedisLockRegistry, but Netty client reject our request because the
    thread is interrupted, therefore we never delete the lock when we yield
    our leadership.
    Fix the issue with shifting a RedisTemplate.delete() operation to the
    ExecutorService when the current thread is interrupted
  • Allow to configure such an ExecutorService and timeout to wait for
    the submit() result
  • Refactor RedisAvailableRule and all the Redis tests do not expose
    the target RedisConnectionFactory implementation.
  • Make all the test-cases based on the connectionFactory created by
    the RedisAvailableTests.setupConnectionFactory()
  • Tweak some unnecessary timeouts and sleeps for better tests task
    throughput

@artembilan
Copy link
Member Author

We may consider this for back-porting, especially the fix for RedisLockRegistry.

@garyrussell
Copy link
Contributor

org.springframework.integration.redis.leader.RedisLockRegistryLeaderInitiatorTests > testDistributedLeaderElection FAILED
java.lang.AssertionError at RedisLockRegistryLeaderInitiatorTests.java:144
142 tests completed, 1 failed, 3 skipped

artembilan added 2 commits May 4, 2018 13:08
The Lettuce client is based on the Netty and more stable, than Jedis
therefore we get a performance improvement for tests
(it saves us at about 30 seconds).
Also this client doesn't fail for me on Windows sporadically (very often)
 with the `ConnectionClosedException`

* After switching to the Netty-based client, we expose the interrupted
Thread issue in the `LockRegistryLeaderInitiator`.
If we interrupted (expected behavior), we try to unlock calling
`RedisLockRegistry`, but Netty client reject our request because the
thread is interrupted, therefore we never delete the lock when we yield
our leadership.
Fix the issue with shifting a `RedisTemplate.delete()` operation to the
`ExecutorService` when the current thread is interrupted
* Allow to configure such an `ExecutorService` and timeout to wait for
the `submit()` result
* Refactor `RedisAvailableRule` and all the Redis tests do not expose
the target `RedisConnectionFactory` implementation.
* Make all the test-cases based on the `connectionFactory` created by
the `RedisAvailableTests.setupConnectionFactory()`
* Tweak some unnecessary timeouts and sleeps for better tests task
throughput
@artembilan
Copy link
Member Author

The Travis is green after the second attempts, but there is indeed something else to do there.
Let's see how it works for you and on CI server!
The Log4j2LevelAdjuster should help us.

@garyrussell garyrussell merged commit b8d4e6b into spring-projects:master May 4, 2018
@artembilan
Copy link
Member Author

@garyrussell ,

Do you want a separate PR for back-porting or are you OK to cherry-pick this fully ?

@garyrussell
Copy link
Contributor

Before backporting, I think we need to be sure the src/main changes still work with the Jedis library.

If you've already done that, we can cherry-pick; if not, we should backport just the src/main changes first.

@garyrussell
Copy link
Contributor

I just reverted src/test and build.gradle and the build is green.

Attempting cherry-pick...

garyrussell pushed a commit that referenced this pull request May 4, 2018
* Use Lettuce Redis client; Redis module fixes

The Lettuce client is based on the Netty and more stable, than Jedis
therefore we get a performance improvement for tests
(it saves us at about 30 seconds).
Also this client doesn't fail for me on Windows sporadically (very often)
 with the `ConnectionClosedException`

* After switching to the Netty-based client, we expose the interrupted
Thread issue in the `LockRegistryLeaderInitiator`.
If we interrupted (expected behavior), we try to unlock calling
`RedisLockRegistry`, but Netty client reject our request because the
thread is interrupted, therefore we never delete the lock when we yield
our leadership.
Fix the issue with shifting a `RedisTemplate.delete()` operation to the
`ExecutorService` when the current thread is interrupted
* Allow to configure such an `ExecutorService` and timeout to wait for
the `submit()` result
* Refactor `RedisAvailableRule` and all the Redis tests do not expose
the target `RedisConnectionFactory` implementation.
* Make all the test-cases based on the `connectionFactory` created by
the `RedisAvailableTests.setupConnectionFactory()`
* Tweak some unnecessary timeouts and sleeps for better tests task
throughput

* Add a `Log4j2LevelAdjuster` into the `RedisLockRegistryLeaderInitiatorTests`
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.

2 participants