-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
time zone issue #12
Comments
This is weird. Can you show the table definition for |
timezone configured in postgresql.conf: "Europe/Berlin" |
So this is stored as UTC: start_time | timestamp with time zone | | not null |
end_time | timestamp with time zone | | | Just to confirm the hypothesis that this is because we have saved a greater end time and start time: Select
extract(EPOCH FROM end_time - start_time)
, *
from data_integration_node_run
where extract(EPOCH FROM end_time - start_time) < 0 (Derived from https://github.com/mara/data-integration/blob/master/data_integration/logging/node_cost.py#L31) My guess is that we actually send in non-TZ aware timestamp which postgresql assumes to be local timzone on the DB. E.g. https://github.com/mara/data-integration/blob/master/data_integration/execution.py#L210 we use datetime.now() which is not timezone aware. (which up to now was new to me... WTF?) |
@jankatins here u go |
Ok, my assumption is that your DB runs in another timezone than your frontend and these pipelines were killed and then closed by https://github.com/mara/data-integration/blob/master/data_integration/logging/run_log.py#L69 which uses the timestamp from the postgresql server and not the frontend. @hz-lschick Does that sound right? If so, then adding the local frontend TZ to all |
The node runs above indeed failed. So that's a valid hypothesis |
@hz-lschick Can you try |
Please have a look at mara/mara-pipelines#34 |
you where right, the timezone of postgres db was off, somehow |
So does mara/mara-pipelines#34 fix your problem? |
@martin-loetzsch seems to work now with the fix |
) The problem was that a) the frontend generated timestamps without timezones which postgresql then interpreted as the UTC but which were actually in the timezone which you ran the python code and b) the closing of open runs after an exception which kills the ETL runner itself (not individual tasks) after an error happened to insert a timestamp with timezone of the time on the postgresql server. -> the error only happens when an exception happens which triggers this code path, i.e. because something shuts down the the runner (e.g. docker instance is shut down or ctrl+c on the command line). Should fix mara/mara-example-project-2#12
Release data-integration 2.8.1 with the fix for this |
had to change the time zone at my postgresql server; seems like that the logging date/time is saved in local time zone and not in UTC. Now my pipeline numbers look totally off:
Suggest to change it that the date time is always saved in UTC in the database to support multiple time zones in the future (e.g. eastern and pacific time).
As a quick-fix the time zone could be configured in the mara app config and always when displaying time the webside the app should calculate the time based on the utc time adjusted with a time bias from the time zone.
The text was updated successfully, but these errors were encountered: