daniel added a comment.

If the new thing allows us to use it as a replacement for passing LoadBalancer to encapsulate connections and for DBConnRef entirely, that would be a way forward, but just adding another thing sounds awry to me.

The new ConnectionManager thingy would be a replacement for passing LoadBalancer + wiki name + groups. It encapsulates the same information as a DBConnRef, but it would be different in some ways:

  • it would not implement the DatabaseBase interface
  • it would not hog a connection permanently.
  • it would not automatically release anything when going out of scope.

To me, DBConnRef is a way to automatically release a connection after using it. It's basically a C++ style "automatic object" version of the Database object. So a DBConnRef's scope should be a single method invocation, it should not be a member. The new ConnectionManager could very well have a getConnectionRef() method in addition to a getConnection() method.

For the task at hand: to whatever is simple and gets the job done. If you don't want to mess with core, the simplest way would be to just pass the groups in addition to the wiki name. Using DBConnRef as a member without any modification is probably not a good idea, because it would hog the DB connection indefinitely.


TASK DETAIL
https://phabricator.wikimedia.org/T147169

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: daniel
Cc: thiemowmde, Addshore, aaron, Aklapper, Smalyshev, Lydia_Pintscher, jcrespo, aude, daniel, hoo, D3r1ck01, Izno, Wikidata-bugs, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to