Add AUTOPAUSE_STATUS_RETRY_LIMIT and AUTOPAUSE_STATUS_RETRY_INTERVAL (#3365)

This commit is contained in:
Geoff Bourne authored and GitHub committed 2025-03-16 13:25:37 -05:00
1 parent 777f4e26b9
commit 7e5f5805a5
4 files changed
+14 -4

No files matched your search

@@ -38,6 +38,8 @@ The following environment variables define the behaviour of auto-pausing:
describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently) describes period of the daemonized state machine, that handles the pausing of the process (resuming is done independently)
- `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0` - `AUTOPAUSE_KNOCK_INTERFACE`, default `eth0`
<br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results. <br>Describes the interface passed to the `knockd` daemon. If the default interface does not work, run the `ifconfig` command inside the container and derive the interface receiving the incoming connection from its output. The passed interface must exist inside the container. Using the loopback interface (`lo`) does likely not yield the desired results.
- `AUTOPAUSE_STATUS_RETRY_LIMIT`, default 10
- `AUTOPAUSE_STATUS_RETRY_INTERVAL`, default 2s
!!! tip !!! tip
+5 -3
View File
@@ -17,12 +17,14 @@ Enable the Autostop functionality by setting:
``` ```
The following environment variables define the behavior of auto-stopping: The following environment variables define the behavior of auto-stopping:
* `AUTOSTOP_TIMEOUT_EST`, default `3600` (seconds) - `AUTOSTOP_TIMEOUT_EST`, default `3600` (seconds)
describes the time between the last client disconnect and the stopping of the server (read as timeout established) describes the time between the last client disconnect and the stopping of the server (read as timeout established)
* `AUTOSTOP_TIMEOUT_INIT`, default `1800` (seconds) - `AUTOSTOP_TIMEOUT_INIT`, default `1800` (seconds)
describes the time between server start and the stopping of the server, when no client connects in-between (read as timeout initialized) describes the time between server start and the stopping of the server, when no client connects in-between (read as timeout initialized)
* `AUTOSTOP_PERIOD`, default `10` (seconds) - `AUTOSTOP_PERIOD`, default `10` (seconds)
describes period of the daemonized state machine, that handles the stopping of the server describes period of the daemonized state machine, that handles the stopping of the server
- `AUTOPAUSE_STATUS_RETRY_LIMIT`, default 10
- `AUTOPAUSE_STATUS_RETRY_INTERVAL`, default 2s
> To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output > To troubleshoot, add `DEBUG_AUTOSTOP=true` to see additional output
+1
View File
@@ -13,6 +13,7 @@ services:
# More aggressive settings for demo purposes # More aggressive settings for demo purposes
AUTOPAUSE_TIMEOUT_INIT: "30" AUTOPAUSE_TIMEOUT_INIT: "30"
AUTOPAUSE_TIMEOUT_EST: "10" AUTOPAUSE_TIMEOUT_EST: "10"
JVM_DD_OPTS: "disable.watchdog:true"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
+6 -1
View File
@@ -37,7 +37,12 @@ mc_server_listening() {
java_clients_connections() { java_clients_connections() {
local connections local connections
if java_running; then if java_running; then
if ! connections=$(mc-monitor status $(use_proxy) --host "${SERVER_HOST:-localhost}" --port "$SERVER_PORT" $(use_server_list_ping) --show-player-count); then if ! connections=$(mc-monitor status \
--host "${SERVER_HOST:-localhost}" \
--port "$SERVER_PORT" \
--retry-limit "${AUTOPAUSE_STATUS_RETRY_LIMIT:-10}" --retry-interval "${AUTOPAUSE_STATUS_RETRY_INTERVAL:-2s}" \
$(use_proxy) $(use_server_list_ping) \
--show-player-count); then
# consider it a non-zero player count if the ping fails # consider it a non-zero player count if the ping fails
# otherwise a laggy server with players connected could get paused # otherwise a laggy server with players connected could get paused
connections=1 connections=1