Skip to content

ResultSet releases Connection only on destruction, taking all capacity from Pool #2

Description

@psafarov

In the following code only gc_collect_cycles() prevents the Pool to run out of connections, otherwise connections don't get released on time. I believe Connection has to be released when the ResultSet reaches its end, not only on ResultSet destruction.

while (true) {
    $resultSet = yield $pool->query("SELECT 1");
    yield \Amp\Iterator\toArray($resultSet);

    gc_collect_cycles();

    yield new Delayed(5000);
}

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions