-
Notifications
You must be signed in to change notification settings - Fork 60
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
Intermittent failures on update task since 3.0.1 #157
Comments
+1 |
Hi! I have the same problem. The problem occurs after few minutes of gradle deamon inactivity. I tried running the following code in the def commandDefinition = CommandFactory.getInstance().getCommandDefinition('update')
println("liquibase-plugin: commandDefinition.name=${commandDefinition.name}")
println("liquibase-plugin: commandDefinition.shortDescription=${commandDefinition.shortDescription}")
println("liquibase-plugin: commandDefinition.longDescription=${commandDefinition.longDescription}")
println("liquibase-plugin: commandDefinition.arguments.keySet()=${commandDefinition.arguments.keySet()}") The first run results are as follows.
After 5 minutes, the results are as follows.
For some reason, I also run the following code in the def commandDefinition = CommandFactory.getInstance().getCommandDefinition('update')
println("liquibase-plugin: commandDefinition.name=${commandDefinition.name}")
println("liquibase-plugin: commandDefinition.shortDescription=${commandDefinition.shortDescription}")
println("liquibase-plugin: commandDefinition.longDescription=${commandDefinition.longDescription}")
println("liquibase-plugin: commandDefinition.arguments.keySet()=${commandDefinition.arguments.keySet()}")
Scope.exit(Scope.getCurrentScope().scopeId)
commandDefinition = CommandFactory.getInstance().getCommandDefinition('update')
println("liquibase-plugin: commandDefinition.name=${commandDefinition.name}")
println("liquibase-plugin: commandDefinition.shortDescription=${commandDefinition.shortDescription}")
println("liquibase-plugin: commandDefinition.longDescription=${commandDefinition.longDescription}")
println("liquibase-plugin: commandDefinition.arguments.keySet()=${commandDefinition.arguments.keySet()}") Result:
|
In a future version of public void resetCommandDefinitions() {
COMMAND_DEFINITIONS.clear();
} |
I don't really understand what Liquibase does with its |
Has anyone found a workaround for this issue, other than not using a Gradle daemon (or stopping it every time) or rolling back to version 2.x of the plugin? I'm having to stop the daemon constantly while doing local builds which is really annoying. Fortunately, we don't use a daemon in our CI/CD pipelines so it's not a problem there. |
@jandrade1 I think the reliable workaround is to use FWIW, I'm not sure there was anything wrong with v2, since this plugin is really just an interface to invoking the liquibase CLI. It doesn't stop you from using the latest liquibase version (at least until liquibase changes its CLI interface) so if this is a major nuissance, that might be the way to go until this gets fixed. |
The problem with v2 is that it doesn't work with newer versions of Liquibase. To use anything newer than (I think) 4.16, we need to update to version 3 of the plugin, which fixes the way the argument list gets built for the CLI in a Liquibase 4.24+ compatible way. I'm not sure why multiple threads would cause different behavior though, but my hunch is that it is a classpath kind of thing. I'm not too familiar with how the daemon works though. |
@stevesaliman thanks for the clarification. We're running Liquibase 4.28 so it sounds like we must use v3.x of the plugin. I really wish I was more familiar with Gradle plugin development to contribute with a PR here, but I'm not. I imagine most people are running Gradle with a daemon and would be running into this issue consistently. |
@jandrade1 FWIW I was using liquibase 4.2X with the v2 plugin just fine before v3 plugin was released. Then again, the only thing I ever ran was the update task and nothing else, so I don't know if other things were broken. Basically my point is if your use case is very simple (like my team's), v2 may still be an option in the short term, but YMMV. You could also just write gradle tasks to shell out to the liquibase CLI directly if that's feasible for you as a temporary workaround. |
@marques-work really appreciate your help here. I'm trying v2.2.2 of the plugin, with a Gradle daemon, and so far so good. I didn't have to make any changes besides just the plugin version number in my build scripts. I also have a simple use case like you where I just invoke the update task. I'll try this a bit more and if it continues to work I'll just stick with v2 until the issue with v3 is fixed. We're recent adopters of Liquibase at my company, and v3 was the first version of the plugin we had tried, so I had not even tested v2 until now. I'm in charge of creating application templates for my company so I need to make sure the build scripts are solid, and it looks like v2 is the answer for now. |
This is directly related to #154
While
./gradlew --no-daemon
and./gradlew --stop
do get around this isusue, it still occurs everytime gradle has cached a deamon, and requiring to kill the daemons everytime is cumbersome.Can this be investigated?
The text was updated successfully, but these errors were encountered: