amphp / postgres

Async Postgres client for PHP based on Amp.
MIT License
96 stars 20 forks source link

$pool->beginTransaction() and $pool->execute() just "hang" forever #56

Closed prolic closed 1 year ago

prolic commented 1 year ago

More code around:

var_dump(__LINE__); // this is the last I see in output
try {
    $pool->query('DROP TABLE IF EXISTS test');
    var_dump(__LINE__); // this I don't see anymore
    $transaction = $pool->beginTransaction();
    var_dump(__LINE__);
    $transaction->query('CREATE TABLE test (domain VARCHAR(63), tld VARCHAR(63), PRIMARY KEY (domain, tld))');
    var_dump(__LINE__);
    $statement = $transaction->prepare('INSERT INTO test VALUES (?, ?)');
    var_dump(__LINE__);
    $statement->execute(['amphp', 'org']);
    $statement->execute(['google', 'com']);
    $statement->execute(['github', 'com']);
} catch (Throwable $e) {
    // we never see this
    var_dump(get_class($e));
    var_dump($e->getMessage());
    var_dump($e->getTraceAsString());
}
prolic commented 1 year ago

using v2 beta, on PHP 8.1.13

prolic commented 1 year ago

Not sure what went wrong, but the issue is gone. Sorry for disturbing.