Project

General

Profile

Actions

Bug #6710

closed

Bug #6731: Out-of-control queries on production server

GES resulting in infinite loop

Added by Boone Gorges about 8 years ago. Updated over 5 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Email Notifications
Target version:
Start date:
2016-11-14
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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

q.txt (831 KB) q.txt Boone Gorges, 2016-11-14 10:35 PM

Related issues

Related to CUNY Academic Commons - Bug #10605: cac-onboarding email sending routine can cause near-infinite db requestsResolvedBoone Gorges2018-10-26

Actions
Actions #1

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

Actions #2

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

Actions #3

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?

Actions #4

Updated by Boone Gorges about 8 years ago

Sure, if we can ignore deprecated across the board, that'd be a win.

Actions #5

Updated by Boone Gorges about 8 years ago

  • Parent task set to #6731
Actions #6

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.

Actions #7

Updated by Boone Gorges about 8 years ago

  • Target version set to Future release

Thanks, Ray!

Actions #8

Updated by Boone Gorges almost 8 years ago

  • Category name set to Email Notifications
Actions #9

Updated by Raymond Hoh about 6 years ago

  • Related to Bug #10633: Tribe__Meta__Chunker->is_supported_post_type runaway queries added
Actions #10

Updated by Raymond Hoh about 6 years ago

  • Related to deleted (Bug #10633: Tribe__Meta__Chunker->is_supported_post_type runaway queries)
Actions #11

Updated by Raymond Hoh about 6 years ago

  • Related to Bug #10605: cac-onboarding email sending routine can cause near-infinite db requests added
Actions #12

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.

Actions

Also available in: Atom PDF