Severe bug in XMLRPC and Windows Live Writer integration related to to_ping
|Reported by:||archon810||Owned by:||ryan|
|Component:||XML-RPC||Keywords:||has-patch needs-testing 2nd-opinion early|
I found a pretty serious performance bug with XMLRPC and Windows Live Writer, which is a really popular post software made by Microsoft in use by many large blogs.
In my continuous fight to improve performance, or rather figure out what the heck is badly slowing down my server, I noticed that I get a lot of stuck doing_cron apache processes after posting and the load shoots up.
I ran strace on some apache processes and found that a lot of them are stuck doing do_pings(), rolling through tons of posts using something like:
SELECT to_ping FROM wp_posts WHERE ID = 27823 SELECT pinged FROM wp_posts WHERE ID = 27823
To figure out why a bunch of my wp cron processes are rolling through random posts trying to ping them all the time, I ran a db query and found that 800+ out of 2900 posts have to_ping field set to
Exactly as above, 2 lines.
So, what I think happens is a bunch of wp cron processes roll through 800 posts all the time and try to ping non-existent servers, which fails. Then the field is not cleared and this happens again and again.
At first, I wasn't able to figure out where this value is coming from, but then it hit me - I was able to trace it back to Windows Live Writer's interface. Take a look: http://farm6.static.flickr.com/5029/5760026936_50895cd36e_b.jpg.
The value here is grayed out, meaning it disappears as soon as you click into it. However, it seems like WLW sends it along anyway, even if the user doesn't fill it in. Then it gets put in the database exactly as above and here we are.
I realize it's not a Wordpress bug per se, but I believe it affects a lot of Wordpress installations that use Windows Live Writer and it's already too late even if MS fixes it. Getting MS to fix it is a whole different business.
So, here are my questions:
- is do_all_pings() really run every time cron runs?
- is it possible that multiple doing_cron processes end up running at the same time due to concurrency issues on very busy servers like mine? I see a ton of them during high load, all running simultaneously. They should really be using a semaphore of some sort.
- can this bug be worked around in Wordpress?
Change History (24)
- Cc admin@… added
- Summary changed from Severe bug in XMLRPC and Windows Live Writer integration to Severe bug in XMLRPC and Windows Live Writer integration related to to_ping
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Keywords has-patch needs-testing 2nd-opinion added; needs-patch removed