micronaut-projects / micronaut-liquibase

Integration between Micronaut and Liquibase
Apache License 2.0
15 stars 10 forks source link

Migrations Often Fail When liquibase.datasources.default.async: true #177

Open JasonTypesCodes opened 3 years ago

JasonTypesCodes commented 3 years ago

When liquibase.datasources.default.async is true, migrations often (but not always) fail. Usually with an error referencing locks or a failure to transition to a state when another is still open. Something like:

Caused by: java.lang.RuntimeException: Cannot end scope omefbvcocj when currently at scope cnlydevtnl

For an example app, please see: https://github.com/JasonTypesCodes/mn-liquibase-259

Starting the app with ./gradlew run will likely illustrate the error. If your change liquibase.datasources.default.async to false, the issues go away.

Environment Information

Example Application

https://github.com/JasonTypesCodes/mn-liquibase-259

ilopmar commented 3 years ago

TBH I think introducing the async migrations wasn't a good idea. I haven't seen this error before until I've tried to upgrade to Liquibase 4.4.x. Now a couple of tests fail (sometimes) with that error.

TheoMuffin commented 2 years ago

I have the same problem using Micronaut v3.1.4. I need liquibase to run asynchronously because multirow inserts for lots of test data (divided into manageable changeset batches) take a long time to run and the microservice should be up and running quite a bit sooner