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: allow to set changelog-lock-wait-time-in-minutes to 0 #375

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

jgarec
Copy link

@jgarec jgarec commented May 30, 2023

Fixes #331

If not, when changelog-lock-wait-time-in-minutes is set to 0 and no lock is in the database, it fails with an error "Could not acquire change log lock. Currently locked by UNKNOWN"

@KushnirykOleh
Copy link

KushnirykOleh commented Jun 27, 2023

Hi @jgarec, thank you for submitting PR.
It fixes issue, but I found 2 things that would be good to improve before merging

  • test that you added passed both with and without changes in AbstractNoSqlLockService if changelog-lock-wait-time-in-minutes is not set to 0 somewhere outside of test
  • if lock is locked, and changelog-lock-wait-time-in-minutes is set to 0 it takes additional 10 seconds to fail as it executes Thread.sleep(getChangeLogLockRecheckTime() * 1000); once and default changeLogLockRecheckTime is 10 seconds. What reduces value of setting changelog-lock-wait-time-in-minutes to zero.

@jgarec jgarec force-pushed the fix/issue_331_wait_time_zero branch from 83ade8d to 2cc3ac5 Compare June 29, 2023 19:59
@jgarec
Copy link
Author

jgarec commented Jun 29, 2023

About your second remark, i think it's better now

@sonarcloud
Copy link

sonarcloud bot commented Jul 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vitaliimak
Copy link

Hello @jgarec.
Thank you for your effort! Your fix looks good to me.
However, during the internal discussion, we concluded to avoid changing the timeouts Liquibase product behaviors in the extension for a specific database.
Would you be interested in suggesting the same fix for Liquibase core? (https://github.com/liquibase/liquibase/blob/master/liquibase-standard/src/main/java/liquibase/lockservice/StandardLockService.java#L253)
If the proposed change gets accepted by the Liquibase core team, we can than reflect it into the extension.

@jgarec
Copy link
Author

jgarec commented Aug 30, 2023

hello @vitaliimak, a similar fix is now included in liquibase core : liquibase/liquibase#4609

@vitaliimak
Copy link

Hi @jgarec
Thank you for the reminder.
I see that the logic in liquibase/liquibase#4609 is slightly different than in this PR. Let me check if everything has been tested properly in liquibase. Then this PR will need to be changed to reflect the liquibase-core code.

@vitaliimak
Copy link

Hi @jgarec
Thank you very much for solving this issue. I appreciate your patience.
The fix in the liquibase core has been tested. I'll merge this PR as is.

@vitaliimak vitaliimak merged commit 561dc0f into liquibase:main Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

can't set changelog-lock-wait-time-in-minutes parameter to 0
3 participants