Redeploy option in vertx3-exec docker container causes OOM

已查看 97 次
跳至第一个未读帖子

Nikolai Raitsev

未读,
2016年4月19日 17:36:162016/4/19
收件人 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

未读,
2016年4月20日 02:37:572016/4/20
收件人 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

未读,
2016年4月20日 18:15:332016/4/20
收件人 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

未读,
2016年4月21日 05:12:412016/4/21
收件人 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

未读,
2016年4月21日 06:26:252016/4/21
收件人 vert.x
Hi Clement,

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

clement escoffier

未读,
2016年4月21日 09:09:052016/4/21
收件人 ve...@googlegroups.com
Don't forget the --launcher-class option.

Clement

Nikolai Raitsev

未读,
2016年4月21日 17:43:072016/4/21
收件人 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
回复全部
回复作者
转发
0 个新帖子