WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#19263 closed defect (bug) (invalid)

Possible Akismet concurrency issue in comment-check

Reported by: archon810 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Cron API Keywords:
Focuses: Cc:

Description (last modified by nacin)

I've been working at narrowing down high load on a busy server and noticed what seems to be a bunch of concurrency problems.

The main one is wp-cron running in multiple HTTP threads and destroying the server (see #17462), so this may be related if what you see below is a result of wp-cron tasks.

However, if it's not, then akismet seems to be suffering from the same issue.

I'm using dd32's http://wordpress.org/extend/plugins/core-control to log these requests. Notice a lot of them on the exact same second, which points at a concurrency issue.

	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 10:06:45
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 10:06:24
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 10:04:39
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 10:02:18
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 10:01:01
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 10:00:07
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:38
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:59:26
	GET http://api.twitter.com/1/users/show.json?screen_name=AndroidPolice	200ok	0.052s	2011-11-16 09:59:24
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:58:47
	POST http://.rest.akismet.com/1.1/comment-check	200ok	0s	2011-11-16 09:58:17

So, are these the result of poor cron locking in <3.3 or is there a separate issue here altogether?

Change History (10)

comment:1 @archon8104 years ago

  • Cc admin@… added

comment:2 @johnbillion4 years ago

  • Cc johnbillion@… added

comment:3 @kurtpayne4 years ago

  • Cc kpayne@… added
  • Keywords reporter-feedback added

It looks like this is from Akismet's automatic retry code.

From my reading of the code ... If a comment check fails, akismet checks back in 20 minutes (via cron). It actually checks up to 100 comments in the database which are marked for retry. This could explain the stream of activity you're seeing.

You can check this by looking at your comments table and clicking on "History." You should see a log of Akismet activity.

comment:4 @archon8104 years ago

  • Keywords reporter-feedback removed

Since the UI only has history per comment, I went to the database and looked at the commentmeta table instead. I have a feeling entries there are deduped by comment_id, for akismet at least, because I don't see any duplicate entries at all. So, even if 10 threads did things at the same time, I'm pretty sure they would have all updated the same row and left only one entry in.

Since you mentioned cron, there's also a high chance it was cron screwing up and launching multiple updates at the same time, but on high-traffic sites it's hard to say, and this concurrency issues comes up in a lot more places you would think.

comment:5 @kurtpayne4 years ago

  • Component changed from Performance to Cron

comment:6 @nacin4 years ago

Wait, is this a report from 3.2.1? In that case, probably best to call this reporter-feedback to see if it is still reproducible on trunk. Akismet is a plugin, so you'd need to submit a bug report to them. If it was a cron locking thing, I'd want to study the bug report, but 3.3 changed how cron locking worked.

comment:7 @archon8104 years ago

I couldn't easily find a place to submit Akismet reports, so since it's an Automattic project that ships with Wordpress, I submitted it here.

I am hesitant to update to trunk on a production site, but I'll be glad to do so once the final version is out at the end of November.

comment:8 @nacin4 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

I don't know how Akismet currently handles bug reports, but you can report it against their tag on the support forums: http://wordpress.org/tags/akismet?forum_id=10.

3.3 should be out by the end of the year; it won't be November.

I removed your API key from the ticket. If you feel you should get that changed now, you should contact Akismet: https://akismet.com/contact.

comment:9 @Ipstenu4 years ago

That contact form would also be a good place to file the bug report. (Can I have 3.3 by Hanukkah, Nacin?)

comment:10 @archon8104 years ago

Thanks, Nacin, didn't realize the API key was part of the url. Don't really care much whether someone knows it or not, I don't see how it could be mis-used. I hope cron fixes will fix this issue, if not I'll try Akismet support.

Note: See TracTickets for help on using tickets.