Redeploy option in vertx3-exec docker container causes OOM

97 views
Skip to first unread message

Nikolai Raitsev

unread,
Apr 19, 2016, 5:36:16 PM4/19/16
to vert.x

Hi,

just tried vertx-exec container with one groovy file and redeploy option. This causes an OOM and container dies. Does someone have some hint, how I can enable redeploy during development with vertx and docker?

Thank you in advance!

:~/verticles# docker run -d \
>     --name vertx-hello \
>     --expose 80 \
>     -v $PWD:/verticles vertx/vertx3-exec \
>     run /verticles/hello-verticle.groovy --redeploy=/verticles/hello-verticle.groovy \
>     -cp /verticles/*
c9d13367c33d60204f3c94275d9f9b37d82289a52f43e1174632d845a9a84f45
:~/verticles# docker logs -f vertx-hello
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.io.UnixFileSystem.resolve(UnixFileSystem.java:108)
at java.io.File.<init>(File.java:262)
at java.io.File.listFiles(File.java:1212)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:90)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)
at io.vertx.core.impl.launcher.commands.Watcher.addFileToWatch(Watcher.java:95)


Clement Escoffier

unread,
Apr 20, 2016, 2:37:57 AM4/20/16
to ve...@googlegroups.com
Hi,

I have to say I never thought about this case. I can see why it fails as it may try to monitor the complete file system of the container (and that’s huge). Let me try to see if there is an easy workaround. Once that would work for sure is to change the CWD in the docker file.

Clement


--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/c3a00a0d-361c-44d8-b8a8-21fdf481d142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nikolai Raitsev

unread,
Apr 20, 2016, 6:15:33 PM4/20/16
to vert.x
Hi Clement, 

thank you for your response.

Have looked around into the code...

Maybe at line 82 here https://github.com/eclipse/vert.x/blob/master/src/main/java/io/vertx/core/impl/launcher/commands/Watcher.java
addFileToWatch(root);

should be not only root, but root + includes?

In my eyes, it makes not to much sense, to watch for whole cwd...

Should I try to provide a PR?

Best regards,

Nikolai

Clement Escoffier

unread,
Apr 21, 2016, 5:12:41 AM4/21/16
to ve...@googlegroups.com
Hi,

Can you try with something like:

docker run -i -t -p 8080:8080 \
    -v $PWD:/verticles -w /verticles vertx/vertx3-exec \
    run MyGroovyVerticle.groovy --redeploy="*.groovy" --launcher-class=io.vertx.core.Launcher

Notice the -w option setting the working directory in docker. So vert.x runs in this directory and reduce the set of watched files.

Clement



Nikolai Raitsev

unread,
Apr 21, 2016, 6:26:25 AM4/21/16
to vert.x
Hi Clement,

thanks for you reply, tried with -w already and got ClassNotFound run. But will try again later.

clement escoffier

unread,
Apr 21, 2016, 9:09:05 AM4/21/16
to ve...@googlegroups.com
Don't forget the --launcher-class option.

Clement

Nikolai Raitsev

unread,
Apr 21, 2016, 5:43:07 PM4/21/16
to vert.x
Hi Clement,

yes, it works now with both options: -w for working directory in docker an --launcher-class for vertx.

Many thanks!

Nikolai
Reply all
Reply to author
Forward
0 new messages