Instance ownership is supposed to protect LoadBalancer and Database against unauthorized calls to internal methods other than by the owning LoadBalancer/LBFactory. This seems like unnecessary complexity. It was introduced for T231443 and T217819, but the link was speculative and in the end it didn't help to fix or isolate those bugs. Since then it has caused a production error (T303885) and an intermittent CI failure (T292239). Instead, split the ILoadBalancer interface, introducing ILoadBalancerForOwner, which contains the methods which are only safe to call by LBFactory or by the caller of LBFactory::newMainLB(). This allows phan to statically detect inappropriate calls to internal methods. Ownership was used for convenience for two things unrelated to its original purpose: * Suppressing calls to ScopedCallback::newScopedIgnoreUserAbort() when the caller has already called it. But nested calls are apparently harmless, so I just called it unconditionally. * Suppressing exceptions from Database::close(). I extended the behaviour for owned instances to apply to all instances, so even unowned instances will no longer throw on close. CodeSearch suggests nothing in extensions is calling these methods with an owner parameter. One extension (Wikibase) overrides a method with an owner parameter in a test mock class and so needs to be simultaneously updated. Depends-On: Ib03aba9d8f5f05b875a321d00b14483633a636a8 Change-Id: I27ba4973d24d759c88b3868c95e7db875801ca0c |
||
|---|---|---|
| .. | ||
| connectionmanager | ||
| database | ||
| dbal | ||
| encasing | ||
| exception | ||
| field | ||
| lbfactory | ||
| loadbalancer | ||
| loadmonitor | ||
| platform | ||
| querybuilder | ||
| ChronologyProtector.php | ||
| defines.php | ||
| TransactionProfiler.php | ||