https://bugzilla.wikimedia.org/show_bug.cgi?id=33036
Web browser: ---
Bug #: 33036
Summary: find a better fix on LoadBalancer connection error
Product: MediaWiki
Version: 1.19-svn
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: Database
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Bug 29233 has been fixed by Tim with r90266 in REL1_17 and r96517 in trunk.
The commit message ask for a cleaner way to handle a database connection error:
Temporary fix which roughly restores the 1.16 behaviour of openConnection(),
returning a Database object with mOpened = false if the connection fails.
However, the idea of throwing an exception from a constructor and then holding
on to a reference to the constructed object by saving it in the exception
object seems kind of icky. Needs a better fix in trunk.
Code snippet:
try {
$db = DatabaseBase::newFromType( $server['type'], $server );
} catch ( DBConnectionError $e ) {
// FIXME: This is probably the ugliest thing I have ever done to
// PHP. I'm half-expecting it to segfault, just out of disgust. -- TS
$db = $e->db;
}
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l