Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3498468
D5050.id16327.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
747 B
Referenced Files
None
Subscribers
None
D5050.id16327.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5050: [server] avoid creating multiple connection pools
Attached
Detach File
Event Timeline
Log In to Comment