Bug #6710
closedBug #6731: Out-of-control queries on production server
GES resulting in infinite loop
0%
Description
In response to recent server problems, I've written a diagnostic tool that sends me a notification any time a WP request exceeds 200 database queries. (Some interesting discoveries!!) The reasoning is that the performance problems seem like they're due to a script that is improperly querying the database too much - like a bad loop.
I found some GES behavior that is a bit wonky, and was hoping I could get Ray's eyes on it. A log file is attached (see the query list at the end). A lot of what's happening here is just the result of uncached queries - an independent issue. But, without completely understanding what's happening, there seems to be too much back-and-forth between GES and bp_get_email(). There's a bunch of hooking and unhooking in ass_send_email() - is it possible that there's a load-order issue, so that something that ought to be unhooked isn't getting unhooked in time?
I'm going to continue diagnosing myself, but I wanted to get this in front of you as soon as I could, because you might be able to see something that's not obvious to me.
Files
Related issues
Updated by Raymond Hoh about 8 years ago
Since we now add the GES email content during upgrade, I think I might be able to remove the runtime term_exists()
check in GES to remove some of the DB queries.
Basically, remove this line:
https://github.com/boonebgorges/buddypress-group-email-subscription/blob/master/bp-activity-subscription-functions.php#L456
Updated by Boone Gorges about 8 years ago
Yeah, that's a good point. It will help.
On review, I don't think that what's in this log is really an infinite loop. There may be some inefficiencies, though, and it would make sense if it were connected to the BP 2.5 email migration. So please continue to think it over from your end :-D
Updated by Raymond Hoh about 8 years ago
Also, when I looked at this a few weeks ago, I remember seeing the BP deprecated email filters firing a lot during the email sendout runtime. Maybe we can disable them? If not, we can post a ticket upstream.
Perhaps we can use BP_IGNORE_DEPRECATED
? I know there were some issues in BP 2.7.x with this, but maybe it's worth giving it a shot on cdev?
Updated by Boone Gorges about 8 years ago
Sure, if we can ignore deprecated across the board, that'd be a win.
Updated by Raymond Hoh about 8 years ago
The taxonomy type check has been removed during email sendouts.
See:
https://github.com/cuny-academic-commons/cac/commit/718744b8b8e6014965d303a8e3bcd30dff0aeaf9
Still need to look into disabling the email filters. I think I might try a more, cautious approach, rather than turning off all BP deprecated code.
Updated by Boone Gorges almost 8 years ago
- Category name set to Email Notifications
Updated by Raymond Hoh about 6 years ago
- Related to Bug #10633: Tribe__Meta__Chunker->is_supported_post_type runaway queries added
Updated by Raymond Hoh about 6 years ago
- Related to deleted (Bug #10633: Tribe__Meta__Chunker->is_supported_post_type runaway queries)
Updated by Raymond Hoh about 6 years ago
- Related to Bug #10605: cac-onboarding email sending routine can cause near-infinite db requests added
Updated by Raymond Hoh over 5 years ago
- Status changed from New to Resolved
The efforts made in #10605 means we can close this one out.