Skip to content

ENABLE_AUTOPAUSE=TRUE and EXEC_DIRECTLY=true possibly incompatible, fail-fast or document #1174

@javabrett

Description

@javabrett

Enhancement Type

Improve an existing feature

Describe the enhancement

Docker version 20.10.10, build b485636 on MacOS

TL;DR: When running with ENABLE_AUTOPAUSE=TRUE and EXEC_DIRECTLY=true, the auto-pause loop misbehaves, logging an endless cycle of pause/knock-unpause, even when there are definitely no knockers.

Cause: EXEC_DIRECTLY=true seems to interfere with pkill -STOP java - checking with ps in-container, the process does not see the signal and does not move from state S to T. This confuses the sleep auto-pause state-machine and it will repeat (blank lines added for readability):

[Autopause loop] MC Server listening for connections - stopping in 60 seconds

[Autopause loop] No client connected since startup / knocked - stopping
[21:53:58] [RCON Listener #1/INFO]: Thread RCON Client /127.0.0.1 started
[21:53:58] [Server thread/INFO]: [Rcon: Saved the game]
[21:53:58] [RCON Client /127.0.0.1 #2/INFO]: Thread RCON Client /127.0.0.1 shutting down
[2021-12-09T21:53:58+00:00] [Autopause] Pausing Java process
[Autopause loop] Server was knocked - waiting for clients or timeout

[Autopause loop] No client connected since startup / knocked - stopping
[21:56:00] [RCON Listener #1/INFO]: Thread RCON Client /127.0.0.1 started
[21:56:00] [Server thread/INFO]: [Rcon: Saved the game]
[21:56:00] [RCON Client /127.0.0.1 #3/INFO]: Thread RCON Client /127.0.0.1 shutting down
[2021-12-09T21:56:00+00:00] [Autopause] Pausing Java process
[Autopause loop] Server was knocked - waiting for clients or timeout

The knock reported in the logs doesn't happen.

I spent some time working this out, so it might be worth either a fail-fast config check, or documentation. If someone can confirm the above analysis is good, I could fashion a PR.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions