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

GH-9291: Enhanced unlock() method of JdbcLock to verify successful unlocking #9292

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

EddieChoCho
Copy link
Contributor

Fixes: #9291

  • Modify unlock() method of JdbcLock: if the lock ownership can not be removed due to data expiration, a ConcurrentModificationException should be thrown.
  • Modify unlock() method of RedisLock: if the lock ownership can not be removed due to data expiration, a ConcurrentModificationException should be thrown.
  • Maintain test cases

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

This also requires respective changes in the lock-registry.adoc, redis.adoc and whats-new.adoc.

The change is aimed for new 6.4 version.

Thanks

@@ -24,8 +24,6 @@

<bean id="lockClient" class="org.springframework.integration.jdbc.lock.DefaultLockRepository">
<constructor-arg name="dataSource" ref="dataSource"/>
<property name="insertQuery"
value="INSERT INTO INT_LOCK (REGION, LOCK_KEY, CLIENT_ID, CREATED_DATE) VALUES (?, ?, ?, ?)"/>
Copy link
Member

Choose a reason for hiding this comment

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

There was a reason to have this in the test: #3866.

Even if it is the same value we have by default, it still covers a respective setter call.
So, please, consider to revert your change.
It is still not relevant to the purpose of this PR.

…y successful unlocking

Fixes: spring-projects#9291
* Modify `unlock()` method of `JdbcLock`: if the lock ownership can not be removed due to data expiration, a `ConcurrentModificationException` should be thrown.
* Modify `unlock()` method of `RedisLock`: if the lock ownership can not be removed due to data expiration, a `ConcurrentModificationException` should be thrown.
* Maintain test cases
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

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

So, all good. Just a couple nit-pics for the doc.

Thanks

@EddieChoCho
Copy link
Contributor Author

Thank you for your feedback and the good reference! I've just pushed another commit.

@artembilan artembilan merged commit 53445fe into spring-projects:main Jul 2, 2024
3 checks passed
@EddieChoCho EddieChoCho deleted the GH-9291 branch July 2, 2024 19:49
@artembilan
Copy link
Member

@EddieChoCho ,

thank you for contribution; looking forward for more!

I know, we have with you a DistributedLock feature outstanding 😄

@artembilan
Copy link
Member

Here is a Migration Guide page we have talked about before: https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-6.3-to-6.4-Migration-Guide

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.

Enhanced unlock() method of JdbcLock to verify successful unlocking
2 participants