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

Wrong timeformat in proving-logs #17

Closed
rjan90 opened this issue May 12, 2022 · 3 comments · Fixed by #19
Closed

Wrong timeformat in proving-logs #17

rjan90 opened this issue May 12, 2022 · 3 comments · Fixed by #19

Comments

@rjan90
Copy link

rjan90 commented May 12, 2022

Hi! We are getting some reports that when doing windowPoSt the timezones in the logs change from their local-time to UTC, which seems to come from the changes in #14

May 07 15:30:52 mXJHY lotus-miner[13876]: 2022-05-07T15:30:52.370+0800        DEBUG        advmgr        sector-storage/sched.go:458        SCHED Acceptable win: [[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []]
May 07 15:30:52 mXJHY lotus-miner[13876]: 2022-05-07T07:30:52.778 INFO storage_proofs_core::compound_proof > vanilla_proofs:finish
May 07 15:30:52 mXJHY lotus-miner[13876]: 2022-05-07T07:30:52.783 INFO storage_proofs_core::compound_proof > snark_proof:start

Also seeing this log when running a wdPoSt-worker.

[flexi_logger][ERRCODE::Time] flexi_logger has to work with UTC rather than with local time, caused by IndeterminateOffset  
    See https://docs.rs/flexi_logger/latest/flexi_logger/error_info/index.html#time

Was just wondering if there is a way to get local-time in the logs, instead of UTC? As debugging/searching logs is easier when the time-format is in local time. Feel free to close this if the cause for this time-mismatch is located in some other repo.

@rjan90 rjan90 changed the title Wrong timeformat Wrong timeformat in proving-logs May 12, 2022
@vmx
Copy link
Collaborator

vmx commented May 12, 2022

This issue occurs in multithreaded programs, and Lotus is multithreaded. Lotus would need to initialize the logger while it's still single threaded (I don't know if that's possible in Go). Then you would get the local time.

If you compile from source, you can try setting RUSTFLAGS="--cfg unsound_local_offset", though be aware that it might lead to unexpected segmentation faults.

@rjan90
Copy link
Author

rjan90 commented May 12, 2022

Thanks for the detailed explenation.😄 I will close this and rather add your comment in the Lotus-issue!

@rjan90 rjan90 closed this as completed May 12, 2022
@vmx
Copy link
Collaborator

vmx commented May 12, 2022

The folks from chrono are working on a proper fix at chronotope/chrono#677. flexi_logger has already a way to use chrono for that offset calculation, so I'd expect that at some time in the future we'll get local times back without any hacks.

paulip1792 added a commit to paulip1792/rust-fil-logger that referenced this issue Sep 25, 2022
chrono has fixed its vulnerability since v4.2.0

Fix filecoin-project#17

Signed-off-by: paulip1792 <paulip1792@outlook.com>
vmx added a commit that referenced this issue Oct 10, 2022
Due to https://rustsec.org/advisories/RUSTSEC-2020-0159, it wasn't possible
to get the local time in multi-threaded contexts. This was fixed with the
latest release v0.24 of `flexi_logger`. It is using a fixed version of
`chrono`, which also means that we don't have a dependency on `time` anymore.

Closes #17, #18.
vmx added a commit that referenced this issue Oct 10, 2022
Due to https://rustsec.org/advisories/RUSTSEC-2020-0159, it wasn't possible
to get the local time in multi-threaded contexts. This was fixed with the
latest release v0.24 of `flexi_logger`. It is using a fixed version of
`chrono`, which also means that we don't have a dependency on `time` anymore.

Fixes #17.
Closes #18.
vmx added a commit that referenced this issue Oct 10, 2022
Due to https://rustsec.org/advisories/RUSTSEC-2020-0159, it wasn't possible
to get the local time in multi-threaded contexts. This was fixed with the
latest release v0.24 of `flexi_logger`. It is using a fixed version of
`chrono`, which also means that we don't have a dependency on `time` anymore.

Fixes #17.
Closes #18.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants