Closed danmichaelo closed 3 years ago
HI @danmichaelo , I think the other reason for the exec "$@" &
and the curl
check is to then allow the call to initialize the dataset (see few lines below)
Isn't it?
I had attempted to do similar kinds of initializations within the entrypoint atomgraph/fuseki-docker
and ended up with similar problems. Decided it's not worth it and got rid of the entrypoint entirely.
It's now the calling service that does the dataset initialization and it works fine.
I would be fine with this approach, but sounds like a major change here. If there is consensus we can proceed, but need to add documentation
Apologies for not watching this repo properly.. Too many emails!
The reason for @
is to support creating empty datasets as well as to delay loading of datasets.
Perhaps this change can be done as part of update to Jena 4.0 with #54 as it would be a breaking change to remove this functionality.
Alternatively the entry-point script can branch depending on if it is in "simple" mode (exec "$@"
) or "create dataset" mode (exec "$@" &
). But then it it is probably better to add a trap
handler - or better - include something more mature like https://github.com/krallin/tini that can wrap our entry point and be PID 1.
Using tini seems to work - Travis shuts down with a kind SIGINT
- equivalent to a Ctrl-C. Ctrl-C locally also works
Thanks, that should work! Reminds me there is also the --init
flag when starting the container, but I prefer the approach of including tini in the image when needed, since it's really the design of the image that decides whether it's needed or not, and it only adds a few kilobytes.
Hi. Just updated jena-fuseki from 3.10.0 3.14.0 and noticed that signal handling no longer seems to be handled correctly. When stopping the container, Docker waits 10 seconds until eventually SIGKILL-ing it (exit code 137):
Here's how it used to work, with java running as PID 1:
The cause seems to be this change. Docker sends the SIGTERM signal to PID 1, but PID 1 is now the docker-entrypoint script.
To me it seems the entrypoint script is doing to much, I don't think it should be the concern of the entrypoint script to wait for the server to be ready. @xgaia , would you be ok with replacing
exec "$@" &
withexec "$@"
and removing everything after line 40 in the entrypoint script?A possibility could be to add a HEALTCHECK instead. A simple version would be
This can also be used with docker-compose to ensure that dependants do not start before Fuseki is ready: