Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tzdata package for Docker TZ environment variable usage #333

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

goofball222
Copy link
Contributor

Add tzdata package for Docker TZ environment variable usage.

Without tzdata installed the container doesn't know how to apply timezone changes / offsets.

…fect

Add tzdata package to allow Docker TZ environment variable to take effect
@wolveix
Copy link
Owner

wolveix commented Sep 24, 2024

@goofball222 thanks for the PR! Have you actually tested whether this makes a difference for the game server? Last I checked, the game server didn't respond to timezone adjustments, making them pointless

@goofball222
Copy link
Contributor Author

It doesn't impact the internal gameserver logging timestamps, however the gameserver does appear to respect the timezone/internal clock setting for its 24h restart period which occurs at 00:00/midnight. The host running this container's timezone is set to UTC.

Log section from the overnight self-restart in the container running with a test build for this tzdata change + Ubuntu 24 configured in UTC -7 TZ=America/Phoenix:

[2024.09.24-03.12.44:579][200]LogGame: World Serialization (save): 0.224 seconds (game thread)
[2024.09.24-03.12.44:953][212]LogGame: Write Backup to Disk and Cleanup time: 0.001 seconds
[2024.09.24-03.12.44:955][212]LogGame: Compression: 0.366 seconds (background)
[2024.09.24-03.12.44:955][212]LogGame: Write To Disk: 0.001 seconds (background)
[2024.09.24-03.12.44:984][213]LogServer: Display: Server startup time elapsed and saving/level loading is done, auto-pause is allowed to proceed from now on (if enabled in server settings). WorldTimeSeconds = 8347.72
[2024.09.24-03.22.45:519][169]LogStreaming: Display: 0.035 ms for processing 1054 objects in RemoveUnreachableObjects(Queued=0, Async=0). Removed 0 (16954->16954) packages and 0 (31912->31912) public exports.
[2024.09.24-04.44.09:937][219]LogSocketsSSL: Warning: Failed to initialize SSL state for Socket HttpRequest
[2024.09.24-04.44.09:937][219]LogHttpListener: Error: Error accepting expected connection [0] SE_NO_ERROR
[2024.09.24-05.32.03:801][150]LogSocketsSSL: Warning: Failed to initialize SSL state for Socket HttpRequest
[2024.09.24-05.32.03:801][150]LogHttpListener: Error: Error accepting expected connection [0] SE_NO_ERROR
[2024.09.24-07.00.00:015][912]LogGame: Display: Session Restart Timer elapsed, rebooting the session to maintain clock stability/game performance.
[2024.09.24-07.00.00:318][914]LogSave: Warning: New/Old Root size mismatch!
[2024.09.24-07.00.00:362][914]LogGame: World Serialization (save): 0.255 seconds (game thread)
[2024.09.24-07.00.00:790][928]LogGame: -09.24.24-00.00.00
[2024.09.24-07.00.00:791][928]LogGame: Succesfully saved a local backup with name: Server_autosave_2_continue-09.24.24-00.00.00.sav
[2024.09.24-07.00.00:791][928]LogGame: Write Backup to Disk and Cleanup time: 0.002 seconds
[2024.09.24-07.00.00:793][928]LogGame: Compression: 0.421 seconds (background)
[2024.09.24-07.00.00:793][928]LogGame: Write To Disk: 0.002 seconds (background)
[2024.09.24-07.00.00:797][928]LogGameMode: Display: Match State Changed from InProgress to LeavingMap
[2024.09.24-07.00.00:797][928]LogGameState: Match State Changed from InProgress to LeavingMap

@goofball222
Copy link
Contributor Author

Also note the time difference in the "continue" autosaves on the folder mapped in from the host:

-rw-r--r-- 1 redacted redacted 1.7M Sep 21 00:00 Server_autosave_0_continue.sav
-rw-r--r-- 1 redacted redacted 1.8M Sep 24 03:12 Server_autosave_0.sav
-rw-r--r-- 1 redacted redacted 1.5M Sep 17 00:00 Server_autosave_1_continue.sav
-rw-r--r-- 1 redacted redacted 1.8M Sep 24 03:12 Server_autosave_1.sav
-rw-r--r-- 1 redacted redacted 1.8M Sep 24 07:00 Server_autosave_2_continue.sav
-rw-r--r-- 1 redacted redacted 1.8M Sep 24 15:30 Server_autosave_2.sav
-rw-r--r-- 1 redacted redacted 1.8M Sep 24 15:35 Server_autosave_3.sav
-rw-r--r-- 1 redacted redacted 1.1M Sep 13 00:00 Server_autosave_4_continue.sav
-rw-r--r-- 1 redacted redacted 1.8M Sep 24 03:08 Server_autosave_4.sav

@wolveix wolveix merged commit e184006 into wolveix:main Sep 24, 2024
2 checks passed
@wolveix
Copy link
Owner

wolveix commented Sep 24, 2024

Thanks @goofball222!!

@goofball222 goofball222 deleted the tzdata branch September 24, 2024 16:30
@GsakuL
Copy link

GsakuL commented Sep 27, 2024

@goofball222 (and everyone reading this) it's not a "24hr interval". I've read on Reddit and Discord, and confirmed by experimenting that this is worded wrong. It is in fact a "time of day". But yeah, thus far it was essentially UTC.

I was about to make an issue this week, but I assumed that the server just used UTC, since passing the TZ via "the usual means" (mapping /etc/zoneinfo, /etc/timezone, TZ env var) did not work. I did not know there are things needed in docker.
so I guess, I've learned something today :)

Edit: oh and to confirm, is the TZ env var needed? Because that would be a prime candidate for a readme addition

@wolveix
Copy link
Owner

wolveix commented Sep 28, 2024

@GsakuL yes, this has been covered multiple times regarding it not being an interval.

The environment variable isn't strictly required, in the same way it realistically never is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants