Skip to content

channel: Panic in .recv_timeout(Duration::MAX) #795

@MightyPork

Description

@MightyPork

https://github.com/crossbeam-rs/crossbeam/blob/master/crossbeam-channel/src/channel.rs#L863

Calling recv_timeout() with Duration::MAX causes panic due to Instant overflow.

This happens quite naturally when the duration comes from some calculation, meaning "wait forever".

I don't think it should crash, insted wait the longest possible time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions