Treat 0 in addition to -1 as an infinite timeout for COPY operations · Issue #6351 · npgsql/npgsql · GitHub
Skip to content

Treat 0 in addition to -1 as an infinite timeout for COPY operations #6351

Closed

Description

@vonzshik

After #6122 we no longer treat 0 as infinite timeout, and instead use -1 for the same purpose. While this is in line with other .NET API (like NetworkStream.ReadTimeout), both NetworkStream and Socket support setting 0 and also treat it as infinite timeout. In addition, setting timeout to 0 currently doesn't make much sense (since it just results in us immediately cancelling the operation). Plus, in this particular case we go against SqlClient (where 0 means infinite timeout).
Which is why it's probably better to relax the change, by also supporting 0 as infinite timeout. Given that we only change COPY operations specifically, this shouldn't be too invasive.

Activity

  1. added this to the 10.0.1 milestone on Nov 24, 2025
  2. self-assigned this
    on Nov 24, 2025
  3. added theissue type on Nov 24, 2025
  4. jurajpaska8 commented on Dec 18, 2025

    @jurajpaska8
  5. roji commented on Dec 18, 2025

    @roji
  6. added 2 commits that reference this issue on Dec 18, 2025
    785b0b8
    12d792a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions