I am testing with newly released Ignition 8.1.38 docker file with leased licensing. 8.1.38 has a new system property called "ignition.license.leased-activation-terminate-sessions-on-shutdown" and if set to true, the gateway should terminate its leased license on normal gateway shutdown. I have a couple of questions:
1: Where do I set the system property "ignition.license.leased-activation-terminate-sessions-on-shutdown"? Can I add this property as an entry into the gateway.xml file located in the container at "/usr/local/bin/ignition/data/gateway.xml"?
2: In our deployment strategy, when we deploy an update a new container is stood up and once its running, the old container is terminated. When termination occurs, Kubernetes sends a SIGTERM signal to the main process (PID 1) to the container which starts a graceful shutdown of the container. Does Ignition gracefully shutdown thus triggering the release of the Ignition license? How long of a grace period is needed for a shutdown? If the graceful shutdown of the container does not trigger a shutdown of the gateway, is there something I need to configure to trigger a gateway shutdown?
Thank you.
The best way to apply this is via the runtime arguments to the container (custom JVM args specifically) as shown here, e.g.:
docker run ... \
inductiveautomation/ignition:8.1.38 \
-n gateway-name -- -Dignition.license.leased-activation-terminate-sessions-on-shutdown=true
As to when this leased licence session termination occurs, you are correct, it will be invoked at the very start of a graceful shutdown (via SIGTERM). The default stop timeout for a container is usually 10 seconds, and we now provide up to 7.5s by default for the async gateway shutdown tasks (such as this new session termination function). The correct stop timeout will depend on your application, though, you may need to extend it if you observe that the container is not finishing shutdown within the alloted time.. It is unlikely that you'll need to extend to timeout for the leased activation session termination on shutdown, but there is a separate system property (see release notes here) if you need it.
EDIT: It looks like in K8s, the default timeout for graceful shutdown is 30s (versus the default 10s in a standalone Docker Engine).
1 Like
Thank you, this will help a lot. Yes, according to our Kubernetes documentation the default grace period is 30 seconds before the Kubernetes issues a SIGKILL signal to the container to kill it. We can add an entry to our Kitt file to extend this time, I just wasn't sure how much time Ignition needed to gracefully shut down the gateway.
Most apps I've seen out there shutdown well within the normal allotment, I doubt you'll need to adjust it.
If you see something like the following in your logs on shutdown, then you've made it
jvm 1 | 2024/03/08 10:04:55 | I [IgnitionGateway ] [10:04:55.034]: Ignition Gateway shut down in 2145ms
wrapper | 2024/03/08 10:04:55 | <-- Wrapper Stopped