Repository navigation
refactor(database): drop Swoole PDOProxy, construct Utopia\Database\PDO directly - #12616
Conversation
✨ Benchmark resultsComparing 1.9.x (before) to fix/drop-pdoproxy (after). Before
After
Delta
Top API waits
|
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
FunctionsServerTest::testCreateExecution |
1 | 17ms | Logs |
Commit 541cdbe - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
FunctionsScheduleTest::testCreateScheduledAtExecution |
1 | 10.59s | Logs |
Commit c8c6255 - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
TablesDBCustomClientTest::testIncrementAttribute |
1 | 240.90s | Logs |
Commit 748d8ef - 1 flaky test
| Test | Retries | Total Time | Details |
|---|---|---|---|
TablesDBCustomServerTest::testOrQueries |
1 | 240.53s | Logs |
Commit 84d4b56 - 2 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
DocumentsDBCustomServerTest::testTimeout |
1 | 132.94s | Logs |
LegacyTransactionsConsoleClientTest::testCommit |
1 | 241.09s | Logs |
Note: Flaky test results are tracked for the last 5 commits
1d254a5 to
5fbbca6
Compare
868dce9 to
9ebd445
Compare
Greptile SummaryThis PR removes the Swoole
Confidence Score: 4/5The PDO refactor in registers.php is correct and the connection-recovery logic moves cleanly into the adapter. The lockfile carries a broader package sweep than the PR title describes, including appwrite/appwrite jumping two major versions and utopia-php/audit 2.5.0 which requires PHP >=8.4 while the project root permits PHP >=8.3. The core registers.php change is clean: Utopia\Database\PDO was already imported, ERRMODE_EXCEPTION is correctly added, and Mongo/Redis paths are untouched. The concern is on the dependency side — utopia-php/audit 2.5.0 declares php: >=8.4 in the lockfile while this branch's platform constraint remains >=8.3, which can cause runtime failures on PHP 8.3 deployments. The lockfile also resolves appwrite/appwrite from 24.2.0 to 26.1.0 and bumps abuse and migration packages, none of which are explained in the PR description or title. composer.json and composer.lock — the resolved dependency set is significantly wider than the described change, and the PHP version floor implied by utopia-php/audit 2.5.0 is higher than the project's declared minimum. Important Files Changed
Reviews (12): Last reviewed commit: "fix: address pdoproxy review comments" | Re-trigger Greptile |
428d83f to
a9a079f
Compare
c8c6255 to
748d8ef
Compare
748d8ef to
84d4b56
Compare
Why
The Swoole
PDOProxykeeps its owninTransactioncounter (incremented onbeginTransaction, decremented only on a successful commit/rollback, never reset onreconnect()or pool checkin). A connection lost mid-transaction leaks the counter and poisons the pooled connection — every laterstartTransactiontrusts the stale counter, does arollBackthe real connection no longer holds, and fails withThere is no active transactionuntil the process restarts.utopia-php/database#896 moves connection-loss recovery into the adapter (
Utopia\Database\PDOStatementreconnect-on-execute, with the pre-existingPDO::__callcovering connection-level calls) and uses the real\PDOas the single source of truth, so the proxy is no longer needed and the desync is structurally impossible.What changed
app/init/registers.php: wrap MySQL/MariaDB/Postgres connections inUtopia\Database\PDOdirectly instead ofSwoole\Database\PDOProxy.PDO::ATTR_ERRMODE => ERRMODE_EXCEPTIONexplicitly (previously the proxy forced it; Fix usage stats disabled home view #896 also defaults it).composer.json: added theutopia-php/databaseVCS repo and repointed the require at the Fix usage stats disabled home view #896 branch (aliasedas 5.9.3).composer.lockdiff is a single entry:utopia-php/database 5.9.2 → #896.Validation
php -l+pint --testclean;composer update --no-installresolves to a one-package lock change. Full e2e runs in CI. Mongo/Redis paths untouched.Related
Cloud counterpart (cloud overrides this
registers.phpat runtime, plus its ownFactory.php): appwrite-labs/cloud#4399.