Repository navigation
fix: read naive ClickHouse datetimes as UTC in the console - #831
Merged
Merged
Conversation
clickhouse-connect returns naive datetimes that are UTC, and _epoch called .timestamp() on them, which reads a naive value as host local time. On a host off UTC every last-seen and bucket epoch the console shows was shifted by the host offset (39600 s on an AEDT host). Containers run UTC, so deployed engines were unaffected; local runs and any non-UTC host were wrong.
|
Released in v1.22.29 -- https://github.com/hyperi-io/dfe-engine/releases/tag/v1.22.29 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clickhouse-connect hands back naive datetimes that are UTC.
_epochcalled.timestamp()on them, and Python reads a naive value as host local time. So on any host off UTC, every console last-seen and bucket epoch was shifted by the host offset: 39600 s on an AEDT host.Containers run UTC, so deployed engines were not affected. Local runs and any non-UTC host were wrong.
appmgmt/operations.py_epoch: a naive datetime is stamped UTC before.timestamp(); an aware one keeps its own zone.hyperi-ci check: 12087 passed, 7 skipped, 3 xfailed.Done when console times match the ClickHouse rows on a non-UTC host.