Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-393

Async pool: hand released connections directly to waiting tasks

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-rc3
    • Other
    • None

    Description

      When the async pool is exhausted, acquire() waits on an asyncio.Condition
      and release() appends the connection to the free list and calls notify().
      Between the notify and the waiter's turn, a newer acquire() can take that
      connection, so the waiter wakes up, finds nothing and waits again: under
      500-way contention about half the wake-ups were wasted (2880 waits for
      1500 acquires). release() also took the lock three times per call.

      Replace the condition with a FIFO deque of waiter futures.

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.