Page MenuHomePhabricator

MW holds DB transaction open across mail()
Closed, InvalidPublic

Description

Author: river

Description:
Using r78054.

In some circumstances (sorry, I don't have a stack trace) MediaWiki holds a database transaction on 'page' open across mail(). If mail() hangs, this blocks all page views (and edits) because the page counter update query can't run.


Version: 1.18.x
Severity: major

Details

Reference
bz26647

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:17 PM
bzimport added a project: MediaWiki-Email.
bzimport set Reference to bz26647.
bzimport added a subscriber: Unknown Object (MLST).

When you say "some circumstance" is there any way a developer could easily reproduce this?

I'm not sure this is a blocker yet, but marking it a blocker anyway.

Removing blocker status until I hear otherwise.

Adding myself to CC.

Was thinking aloud on IRC. First guess is a wiki using enotif that doesn't make use of the jobqueue.

River: can you give us any further info on this? Do you (somewhat) remember what you were doing to trigger it?

mail() should usually be fast: this shells out to sendmail (or equiv) which ships the message into an outgoing queue managed by the mail server. It could be slow on Windows (where mail() actually calls out to an SMTP server directly), or if the local MTA sendmail binary does odd or slow things.

A better mail queuing thingy might be nice, but I'm pretty sure we've done this for the last 8 years plus or minus, so probably not a blocker.

river wrote:

As far as I can tell, the problem will appear any time MW sends mail from an edit. So, watch a page, enable email notification and make an edit. In our case mail() hung due to a Postfix configuration error, but you could probably replace /usr/lib/sendmail with a wrapper script to get the same effect.

Assuming this is obsolete 11 years later as codebases likely have changed quite a bit over time. If not, please open a new ticket. Thanks.