sapling/eden/mononoke/mononoke_hg_sync_job
Aida Getoeva 8b93f52b71 mononoke/mysql: use single static shared connection pool
Summary:
The correct workflow for using a multi-threaded connection pool for multiple DBs is to have a single shared pool for all the use-cases. The pool is smart enough to maintain separate "pools" for each DB locator and limit them to maximum 100 conn per key.

In this diff I create a `OnceCell` connection pool that is initialized once and reused for every attempt to connect to the DB.
The pool is stored in `MononokeAppData` in order to bind its lifetime to the lifetime of Mononoke app. Then it is passed down as a part of `MysqlOptions`.  Unfortunately this makes `MysqlOptions` not copyable, so the diff also contains lots of "clones".

Reviewed By: ahornby

Differential Revision: D25055819

fbshipit-source-id: 21f7d4a89e657fc9f91bf22c56c6a7172fb76ee8
2020-12-17 15:46:30 -08:00
..
helper_lib mononoke: remove unused code 2020-11-30 07:51:08 -08:00
schemas mononoke/hg_sync_job: make mononoke_hg_sync_job public (#37) 2020-07-30 02:52:56 -07:00
src mononoke/mysql: use single static shared connection pool 2020-12-17 15:46:30 -08:00
Cargo.toml autocargo: regen 2020-12-08 18:30:24 -08:00