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

CouldNotGetElapsedTimeFromSystemTime should be ignored #1018

Closed
20051231 opened this issue Jan 25, 2024 · 3 comments · Fixed by rustic-rs/rustic_core#138
Closed

CouldNotGetElapsedTimeFromSystemTime should be ignored #1018

20051231 opened this issue Jan 25, 2024 · 3 comments · Fixed by rustic-rs/rustic_core#138
Labels
A-errors Area: error handling needs improvement C-bug Category: Something isn't working as expected

Comments

@20051231
Copy link

When running a long backup operation, rustic crashed with the following error.

 error: couldn't get elapsed time from system time: `SystemTimeError(1.1449058s)`

After checking the code, the error may be come from these two places where elapsed throws a error.

https://github.com/rustic-rs/rustic_core/blob/0872923397b384a7b39ee092ae660f9d144c67f1/crates/core/src/blob/packer.rs#L521
https://github.com/rustic-rs/rustic_core/blob/0872923397b384a7b39ee092ae660f9d144c67f1/crates/core/src/index/indexer.rs#L187

According to
https://doc.rust-lang.org/std/time/struct.SystemTimeError.html

this error just means the offset is negative and the code is just checking the timeout for writing the pack.
I suspect there is some NTP time sync operation running in between the creation of pack file and the checking function which turn back the system time such that the offset becomes negative.

I think unwrap_or_default is enough in this case since the error is not fatal.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Jan 25, 2024
@aawsome
Copy link
Member

aawsome commented Jan 25, 2024

Thanks a lot for reporting @20051231! You are right - aborting is a wrong handling of this case. I'll make a PR which prints a warning but continues with the backup.

@aawsome aawsome added C-bug Category: Something isn't working as expected A-errors Area: error handling needs improvement and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Jan 25, 2024
@aawsome
Copy link
Member

aawsome commented Jan 25, 2024

Also thanks a lot for your good analysis of the error! If you find more errors, you are also welcome to directly create a PR - this ensures that things are fixed even more quickly!

@aawsome aawsome closed this as completed Jan 25, 2024
@aawsome
Copy link
Member

aawsome commented Jan 25, 2024

sorry - closed by accident

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-errors Area: error handling needs improvement C-bug Category: Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants