Page MenuHomePhabricator

D5050.id16327.diff
No OneTemporary

D5050.id16327.diff

diff --git a/keyserver/src/database/database.js b/keyserver/src/database/database.js
--- a/keyserver/src/database/database.js
+++ b/keyserver/src/database/database.js
@@ -38,6 +38,15 @@
scriptContext && scriptContext.allowMultiStatementSQLQueries
),
};
+
+ // This function can be run asynchronously multiple times,
+ // the previous check is not enough because the function will await
+ // on `getDBConfig()` and as result we might get there
+ // while the pool is already defined, which will result with
+ // creating a new pool and losing the previous one which will stay open
+ if (pool) {
+ return pool;
+ }
pool = mysqlPromise.createPool(options);
databaseMonitor = new DatabaseMonitor(pool);
return pool;

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 9:18 PM (16 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682008
Default Alt Text
D5050.id16327.diff (747 B)

Event Timeline