Skip to content

Conversation

@zappolowski
Copy link
Contributor

Using Instant::now() for is_expired doesn't account for time spent suspended on Linux as it internally uses CLOCK_MONOTONIC. Using SystemTime::now() instead (adjusting timestamp to SystemTime accordingly) fixes this.

Although SystemTime could go backwards (e.g. due to NTP updates), expiration deals with external systems and thus this should be a non-local time anyhow.

Fixes #1617

Using `Instant::now()` for `is_expired` doesn't account for time spent
suspended on Linux as it internally uses `CLOCK_MONOTONIC`. Using
`SystemTime::now()` instead (adjusting `timestamp` to `SystemTime`
accordingly) fixes this.

Although `SystemTime` could go backwards (e.g. due to NTP updates),
expiration deals with external systems and thus this should be a
non-local time anyhow.

Fixes librespot-org#1617
@roderickvd roderickvd merged commit 84a3302 into librespot-org:dev Nov 8, 2025
12 checks passed
@roderickvd
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconnection issues after suspend

2 participants