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

DeadlockLoserDataAccessException during JdbcLock.unlock #3294

Closed
astrubel opened this issue Jun 8, 2020 · 3 comments
Closed

DeadlockLoserDataAccessException during JdbcLock.unlock #3294

astrubel opened this issue Jun 8, 2020 · 3 comments

Comments

@astrubel
Copy link
Contributor

astrubel commented Jun 8, 2020

A DeadlockLoserDataAccessException occurs at org.springframework.integration.jdbc.lock.JdbcLockRegistry$JdbcLock.unlock(JdbcLockRegistry.java:236)

I'm using the 4.3.19 release but no unlock() retrying is present in newer releases.

Could it be possible to retry unlock() in case of TransientDataAccessException like lock()?

while (true) {
	try {
		while (!doLock()) {
			Thread.sleep(100); //NOSONAR
		}
		break;
	}
	catch (TransientDataAccessException e) {
		// try again
	}
	...
}

Thank you in advance!

@astrubel astrubel added status: waiting-for-triage The issue need to be evaluated and its future decided type: bug labels Jun 8, 2020
@artembilan
Copy link
Member

I think I agree with your suggestion: indeed we can retry such an operation until success with no exceptions.

Feel free to raise a Pull Request. Although keep in mind that we are going to release tomorrow, not 4.3.23, but still the fix must be present in the planed versions.

@artembilan artembilan added backport 4.3.x in: jdbc and removed status: waiting-for-triage The issue need to be evaluated and its future decided labels Jun 9, 2020
@artembilan artembilan added this to the 5.4 M1 milestone Jun 9, 2020
astrubel pushed a commit to astrubel/spring-integration that referenced this issue Jun 9, 2020
artembilan pushed a commit that referenced this issue Jun 9, 2020
Fixes #3294

A `DeadlockLoserDataAccessException` occurs at `JdbcLockRegistry$JdbcLock.unlock()` - 
better to retry like in the `lock()`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
artembilan pushed a commit that referenced this issue Jun 9, 2020
Fixes #3294

A `DeadlockLoserDataAccessException` occurs at `JdbcLockRegistry$JdbcLock.unlock()` - 
better to retry like in the `lock()`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
artembilan pushed a commit that referenced this issue Jun 9, 2020
Fixes #3294

A `DeadlockLoserDataAccessException` occurs at `JdbcLockRegistry$JdbcLock.unlock()` - 
better to retry like in the `lock()`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
artembilan pushed a commit that referenced this issue Jun 9, 2020
Fixes #3294

A `DeadlockLoserDataAccessException` occurs at `JdbcLockRegistry$JdbcLock.unlock()` - 
better to retry like in the `lock()`

**Cherry-pick to 5.3.x, 5.2.x, 5.1.x & 4.3.x**
@astrubel
Copy link
Contributor Author

Hi @artembilan,
Thank you very much for the merge!
Have you planed a date for the 4.3.23 version ?
Best regards

@artembilan
Copy link
Member

July 22: https://github.com/spring-projects/spring-integration/milestone/37

Just after Spring Framework 4.3.28!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants