Page MenuHomePhabricator

Review Suggestor MariaDB+Rocket connection handling
Open, Needs TriagePublic

Description

Per https://wikitech.wikimedia.org/wiki/Help:Toolforge/Database#Connection_handling_policy holding open connections is not allowed.

I believe that the connection pool Rocket uses by default *does* hold connections open, so we need to disable that functionality or find some workaround so we're compliant with policy.

https://api.rocket.rs/v0.5-rc/rocket_sync_db_pools/index.html

Event Timeline

https://docs.rs/r2d2/0.8.9/r2d2/struct.Builder.html if we set the min_idle = 0 and max_lifetime = 30s, I think that would fit within the spirit of the policy. Not sure yet how to pass those options via Rocket though.

We could also use diesel directly and skip the Rocket layer but then we have to do all the async -> sync wrapping ourselves.

Change 700019 had a related patch set uploaded (by Legoktm; author: Legoktm):

[labs/tools/suggestor@master] Drop database pooling, use manual connection handling

https://gerrit.wikimedia.org/r/700019