-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Inconsistent timezones in /connz output #6694
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
Comments
There are other places where time is user-facing, and is not in UTC, e.g.: Lines 3162 to 3170 in 99e836e
@wallyqs that was reverted from UTC in: #4154 Instead of thinking which one is user-facing time and which one is not, can we simply set the timezone to be UTC in the beginning of the nats server run, and use time.Now() everywhere, without ever thinking about which is local, and which has monotonic clock?
People do it: |
Might be a good idea.. |
Would certainly simplify things but I worry about doing that If someone embeds the server we wouldn’t want to mess with the timezone unconditionally. And if we don’t then there are significant behaviour change between embedded or not. I suspect best we can do is fix the bugs here |
I think it's OK if we set |
But then embedded nats will return times different from standalone. This seems like a bad outcome. |
I agree might not be good. Would also be nice if a request for info could have a header that asked for the TZ for the results. |
Observed behavior
nats-server -c noauth.conf
Observe that the time zone of
last_activity
depends on a number of messages processed:Client code:
The one in UTC has "in_msgs": 0,, so it is likely was handled by this line:
nats-server/server/client.go
Line 2030 in adb1fcb
It was last changed in #1943
The one with the local timezone has in_msgs != 0, so it is likely was handled by this line:
nats-server/server/client.go
Lines 1256 to 1266 in adb1fcb
It was last changed in #4132
Expected behavior
Consistency.
Server and client version
v2.11.0
nats.go v1.39.0
Host environment
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: