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

Fix: set env var TZ correctly to prevent excessive stat syscalls #6084

Merged
merged 3 commits into from Jun 7, 2022

Conversation

SwoopX
Copy link
Collaborator

@SwoopX SwoopX commented May 28, 2022

The changes set the local timezone environment variable TZ, taking the local time settings into account. To determine the timezone, file /etc/timezone is checked and the respective value used, if existent. Alternatively, i case a previous timezone was already saved in the DB, it is used; fallback is Etc/GMT. The set value will be visible in the debug log as well as in Phoscon's advanced Gateway settings.

To actually set TZ on OS level, the value remains untouched if the variable exists. Alternatively, it is populated with /etc/localtime, the previously determined timezone or the fallback as above.

This has been tested on a Ubuntu 18.04 LTS and RaspbianOS Buster. The timezone gets apparently set appropriately, as the stat calls were reduced to just a few.

It should be seperately tested if and to what extend that might apply to Windows environments as well.

@SwoopX SwoopX linked an issue May 28, 2022 that may be closed by this pull request
@SwoopX SwoopX marked this pull request as ready for review May 31, 2022 18:34
@SwoopX SwoopX added this to the v2.17.0-beta milestone May 31, 2022
@SwoopX SwoopX changed the title Fix: set env var correctly TZ to prevent excessive stat syscalls Fix: set env var TZ correctly to prevent excessive stat syscalls May 31, 2022
@manup manup merged commit 18110e2 into dresden-elektronik:master Jun 7, 2022
@SwoopX SwoopX deleted the timezone branch July 2, 2022 22:08
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.

Excessive stat syscalls on linux
2 participants