-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
tikv-server: check TZ setting #1876
Conversation
Do you use strace to check we don't stat too many /etc/localtime ? |
src/bin/tikv-server.rs
Outdated
@@ -269,6 +270,13 @@ fn check_system_config(config: &toml::Value) { | |||
for e in util::config::check_kernel() { | |||
warn!("{:?}", e); | |||
} | |||
|
|||
if cfg!(windows) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean !cfg!(windows)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣 typo
src/bin/tikv-server.rs
Outdated
if !cfg!(windows) { | ||
if env::var("TZ").is_err() { | ||
env::set_var("TZ", "/etc/localtime"); | ||
error!("environment variable `TZ` is missing, use `/etc/localtime`"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning is better.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
related: pingcap/tidb-ansible#20
If TZ is not set, tikv will stat(/etc/localtime) twice every logging operation.
ref: https://stackoverflow.com/questions/4554271/how-to-avoid-excessive-stat-etc-localtime-calls-in-strftime-on-linux