vert-x3 / vertx-maven-service-factory

Verticle factory for resolving verticles from Maven at run-time
Apache License 2.0
12 stars 12 forks source link

Problems redeploying verticles using SNAPSHOT version #26

Open afterthought opened 7 years ago

afterthought commented 7 years ago

This seems like it might be difficult to turn into a test case, but we're seeing a problem when we have SNAPSHOT services that we deploy and undeploy with the maven verticle factory. It's actually two problems. I was able to monkeypatch the first one though. The first one was that the isolation group remained constant therefore the old classloader was used and the new jar downloaded by aether is ignored. here

I don't think I can workaround the second issue though. Without stopping the JVM, we undeploy the verticle and deploy it again using maven. A new version of the snapshot jar now exists and aether downloads it. It seems like aether makes a copy of the downloaded jar so that the latest version always is the -SNAPSHOT jar. I.e. aether downloads my-jar-1.0.0-dev-isolation4-20170217.201429-2.jar and then also makes a copy called my-jar-1.0.0-dev-isolation4-SNAPSHOT.jar. When the services tries to redeploy we get an error from the ServiceVerticleFactory saying that the "descriptor file is empty" here. I am not sure exactly what is causing this. The class loader is "closable" and the DeploymentManager doesn't close it, but the behavior seems like it is more related to caching going on inside the JarURLConnection class maybe.

For now my workaround will be restarting the JVM since so far this only seems related to snapshots and therefore it's only a problem on our development server. I just figured I should report the information.

vietj commented 5 years ago

thanks for reporting, perhaps you should avoid snapshots and use versions instead ?