Last modified: 2013-05-13 11:38:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48476, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46476 - Running dispatchChanges as cronjob doesn't close down as expected
Running dispatchChanges as cronjob doesn't close down as expected
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Highest major (vote)
: ---
Assigned To: Wikidata bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-23 03:05 UTC by jeblad
Modified: 2013-05-13 11:38 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description jeblad 2013-03-23 03:05:24 UTC
When dispatchChanges.php is run as a cronjob it seems like it (as least sometimes) doesn't close down as expected, and then doesn't release the database connections. After a while MySQL then runs out of free connections, and then Mediawiki and other processes on the server grinds to a halt.

Either a PID-file should be used to stop new processes from starting, or a proper close should be done, or a proper daemon should be made. Restarting new processes from crontab without knowing if the previous ones are properly closed is bad.
Comment 1 jeblad 2013-03-23 03:08:16 UTC
Setting this to highest and major until it can be verified if this script is indeed expected to be run from crontab. If so, and that is the intended use at WMF, then it should be critical or a blocker.
Comment 2 Aude 2013-03-25 10:17:50 UTC
don't know if it's related but kept getting system error and system reboot during the weekend while running the dispatcher.

when I stopped the dispatcher cronjob, then had no issues:

1Mar 23 13:30:01 hathor suhosin[5998]: ALERT - script tried to disable memory_limit by setting it to a negative value -1 bytes which is not allowed (attacker 'REMOTE_ADDR not set', file 'unknown')
Comment 3 Daniel Kinzler 2013-03-25 10:29:24 UTC
For reference:

* I didn't change anything about the way the dispatcher script is launched, kept alive, or terminated. It should behave as before. Can you please provide the exact setup that casued problems?

* per default, the number of passes before quitting is the number of client wikis. So, if you have 6 client wikis configured, the dispatcher will do 6 passes, then exit. When the process exits, the database connection is closed. Does the process somehow lock up and stay around? Also, please run with the --verbose option for more helpful output.

* when run from cron, the --max-time option should be set the the period at which the cron job is run, so the old dispatcher terminates when the new one is started. Ideally, we'd never need to do this, and this could be set to "one a year". In practice, something between 10 minutes and 1 hours seems sensible, because it allows for a swift recovery should the dispatcher die.

* dispatchChanges itself doesn't mess with the memory limit; MediaWiki does so per default I think. even if it did, I have no idea how that could trigger a reboot.

* since ops requested a proper daemon, I guess that's the way top go. I'd be happy if I wouldn't have to code that, though.
Comment 4 Daniel Kinzler 2013-03-25 13:25:42 UTC
Confirmed:

When running dispatchChanges without the --max-time parameter (and thus, relying on --max-passes, possibly using the default value), the script would loop until the given number of changes where successfully completed. However, if there were no new changes, there was nothing to dispatch, and "idle" passes were not counted as completed. So the process would be "stuck" until a new change was recorded.

The solution is to count idle passes against --max-passes as well.

patch: I525152d3
Comment 5 Andre Klapper 2013-04-03 11:46:30 UTC
(In reply to comment #4)
> patch: I525152d3

Aude / jeblad / Daniel:  The patch has been merged. What work is left here? Or can this bug report be closed as FIXED?
Comment 6 jeblad 2013-04-15 17:51:12 UTC
I think this can be closed as fixed

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links