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

Fix LockRegLeaderIn for interrupted Thread.sleep #2455

Merged
merged 2 commits into from
May 30, 2018

Conversation

artembilan
Copy link
Member

https://build.spring.io/browse/INT-FATS5IC-517

If current thread is interrupted, the Thread.sleep() interrupts
immediately.
In the catch block of the main loop in the LockRegistryLeaderInitiator
we have such a dangerous sleep() and don't restart election in this
candidate any more

  • Move Thread.sleep() to else after checking the current thread for
    interrupted state
  • Remove LongRunningIntegrationTest rule from the
    RedisLockRegistryLeaderInitiatorTests since it now works much faster
    after proper busy-wait handling

Cherry-pick to master

https://build.spring.io/browse/INT-FATS5IC-517

If current thread is interrupted, the `Thread.sleep()` interrupts
immediately.
In the catch block of the main loop in the `LockRegistryLeaderInitiator`
we have such a dangerous `sleep()` and don't restart election in this
candidate any more

* Move `Thread.sleep()` to else after checking the current thread for
interrupted state
* Remove `LongRunningIntegrationTest` rule from the
`RedisLockRegistryLeaderInitiatorTests` since it now works much faster
after proper `busy-wait` handling

**Cherry-pick to master**
@garyrussell garyrussell merged commit 7f898a5 into spring-projects:5.0.x May 30, 2018
garyrussell pushed a commit that referenced this pull request May 30, 2018
* Fix LockRegLeaderIn for interrupted Thread.sleep

https://build.spring.io/browse/INT-FATS5IC-517

If current thread is interrupted, the `Thread.sleep()` interrupts
immediately.
In the catch block of the main loop in the `LockRegistryLeaderInitiator`
we have such a dangerous `sleep()` and don't restart election in this
candidate any more

* Move `Thread.sleep()` to else after checking the current thread for
interrupted state
* Remove `LongRunningIntegrationTest` rule from the
`RedisLockRegistryLeaderInitiatorTests` since it now works much faster
after proper `busy-wait` handling

**Cherry-pick to master**

* Ignore interruption on the sleep i catch and move on with loop
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