Page MenuHomePhabricator

Flip deprecations of ConnectionManager::get*Connection(Ref)
Closed, ResolvedPublic

Description

Currently, in Wikimedia\Rdbms\ConnectionManager (a MediaWiki core class, though mainly used in Wikibase I believe), getWriteConnection() and getReadConnection() are deprecated (since 1.38) in favor of getWriteConnectionRef() and getReadConnectionRef(); at the time, the underlying ILoadBalancer::getConnection() required a matching call to reuseConnection(), while ILoadBalancer::getConnectionRef() automatically released itself based on ref counting. In T255493, the difference between these two methods was eliminated – getConnection() is now an alias for getConnectionRef() (i.e. all connections are reference-counted), but callers are encouraged to use the shorter getConnection() name, and getConnectionRef() is @deprecated since 1.39. The ConnectionManager methods should be updated to match this: getWriteConnection() and getReadConnection() should be undeprecated, and getWriteConnectionRef() and getReadConnectionRef() be deprecated instead (along with releaseConnection()).

Event Timeline

Change 811938 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] Flip ConnectionManager deprecations to match ILoadBalancer

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

Krinkle triaged this task as Medium priority.

Change 811938 merged by jenkins-bot:

[mediawiki/core@master] rdbms: Flip ConnectionManager deprecations to match ILoadBalancer

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