Author: ronald
Description:
We run a fairly large corporate Wiki (150k+ users) using mediaWiki v1.17, PHP 5.2.6 on a WAMP stack. We notice that sometimes jobs that are executed on the command line (using the PHP passthru command) get stuck. These jobs include:
- Image thumbnailing (ImageMagick)
- PDF generating (using an extension and external PDF generator)
- Math conversion (LaTex)
The cause and symptoms are as follows:
- 2 command line jobs are requested at more or less the same time
- One of the jobs hangs: Taskmanager will show 'cmd'and 'convert' jobs that never finish, and one of Apache's worker threads will remain in W state.
- More jobs get requested and will get stuck as well, to the point where all Apache worker threads are locked.
I can reliably reproduce this issue in our test environment.
The bug appears to be caused by a known PHP issue: https://bugs.php.net/bug.php?id=44942
A workaround for this bug has been tested: we have modified includes/GlobalFuncitons.php with the suggested fix, that is: call session_write_close() before calling passthru(), and calling session_start() afterwards.
Given that this is a (long-standing) PHP bug, is this something that should be fixed in the MediaWiki core code? At this time, it appears to be our only option.
Version: 1.17.x
Severity: normal
Platform: PC