Skip to content

Reexamine internal vs. user timeouts #3045

Closed

Description

@roji

We have a feature where we allow a different timeout to be defined for "internal commands" (InternalCommandTimeout instead of UserTimeout). This is meant to also apply to prepended commands (which are always "internal"), but it seems to be broken: if there are prepended responses, we set ReceiveTimeout to InternalcommandTimeout, but then recursively call ReadMessageLong which will overwrite it with UserTimeout.

  • One problem I have with InternalCommandTimeout is that like the regular CommandTimeout, it's pretty coarse; we could make it affect committing, but it would also affect rolling back, and various other internal stuff. So having a single "internal" value doesn't seem to be considerably more helpful than just using the general timeout on the connection.
  • Specifically for transactions, we could add a timeout property to the transaction, and that value would be used when committing and rolling back; this would be similar to how you can set a per-command timeout.

We should review the original motivation for having this separate timeout, and consider removing it. If we don't remove it, we should fix the implementation here, for both sync and async.

Activity

  1. added this to the Backlog milestone on Jun 27, 2020
  2. modified the milestones: Backlog, 8.0.0 on Jan 8, 2023
  3. self-assigned this
    on Jan 8, 2023
  4. modified the milestones: 8.0.0, Backlog on Nov 7, 2023
  5. added a commit that references this issue on Nov 20, 2023
  6. NinoFloris commented on Jun 27, 2024

    @NinoFloris
    Member

    Completed in #4856

  7. emz00 commented on Jun 28, 2024

    @emz00
    Contributor

    So what is the fix - the UserTimeout is used also for internal commands now?

  8. vonzshik commented on Jun 28, 2024

    @vonzshik
    Contributor

    So what is the fix - the UserTimeout is used also for internal commands now?

    Yep. Right now we only have 2 internal commands: one is for BEGIN TRANSACTION and another is for connection reset. Both of them should be extremely quick, so in general users don't really need to change their timeout anyway. And since it never worked in the first place and removing it does simplify code quite a bit, well...

  9. modified the milestones: Backlog, 8.0.0 on Oct 21, 2024
  10. added theissue type on Jun 18, 2025
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