Skip to content

Look into merging or linking connector binding scopes and user actions #3260

Closed as not planned

Description

@roji

We currently have two separate mechanisms that encompass entire "operations":

  • User action. This is old, and was mainly about having a concurrency detection mechanism, to throw meaningful exceptions when users accidentally use a connection in an un-safe way. It also makes sure we don't perform an application keepalive while a user operation is in progress.
  • Connector binding scope. This is new in 5.0, and is about binding and unbinding connections and connectors.

We should look into merging or somehow linking these two mechanisms. One good example of an issue is NpgsqlTransaction.Commit:

using (_connector.StartUserAction())
{
    Log.Debug("Committing transaction", _connector.Id);
    await _connector.ExecuteInternalCommand(PregeneratedMessages.CommitTransaction, async, cancellationToken);
}

The binding scope ends when the RFQ message is received within ExecuteInternalCommand; this returns the connector to the pool when in multiplexing. But the user action is ended afterwards; it's forbidden to change connector state after returning it to the pool.

See #3255 which is somewhat related.

Activity

  1. modified the milestones: Backlog, 5.0.0 on Oct 22, 2020
  2. self-assigned this
    on Oct 22, 2020
  3. roji commented on Oct 25, 2020

    @roji
    MemberAuthor

    Note that after #3266, this is no longer a source of bugs, but we should still consider doing it to clean up the design. Moving out of 5.0.0.

  4. modified the milestones: 5.0.0, Backlog on Oct 25, 2020
  5. removed their assignment
    on Oct 25, 2020
  6. vonzshik commented on Jan 18, 2023

    @vonzshik
    Contributor

    We can probably close this since #4839 removes binding scopes.

  7. roji commented on Jan 18, 2023

    @roji
    MemberAuthor

    Yep, makes sense.

  8. removed this from the Backlog milestone on Jan 18, 2023
  9. 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

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions