Opened 14 months ago
Last modified 9 months ago
#20537 new defect (bug)
Don't spawn cron requests for suspended blogs
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Cron | Version: | 3.3.1 |
| Severity: | normal | Keywords: | has-patch 2nd-opinion |
| Cc: | kpayne@… |
Description (last modified by ryan)
For multisite, spawning cron requests is wasteful and unnecessary. wp_cron()/spawn_cron()/wp-cron.php should check the blog's status and bail if the blog is suspended.
Attachments (2)
Change History (8)
comment:2
nacin
— 14 months ago
I think spawning is unnecessary. wp-cron.php should still be able to be triggered, though. Someone somewhere is surely doing something weird with regards to this.
I think it would be best if bailed early in spawn_cron() and didn't hook wp_cron() directly into sanitize_comment_cookies. That would allow for wp_cron() and wp-cron.php to still execute.
I could also just be overly careful.
comment:3
follow-up:
↓ 6
ryan
— 14 months ago
- Description modified (diff)
I can see it being good and bad, at least when considering core events. A hard freeze prevents future posts from accidentally getting published and pingbacks from accidentally going out from a blog that should be dead. The blog and the cron queue are frozen. Then again, there could be some events that should still be processed. This was requested by some wp.com folks to shut up zombie blogs. How dead is dead enough?
comment:4
ryan
— 14 months ago
And, yes, spawning should be shut down and the hook avoided. Finishing the patch tomorrow.
comment:5
kurtpayne
— 13 months ago
- Cc kpayne@… added
- Keywords has-patch 2nd-opinion added
20537.2.patch is the same as 20537.diff, but in a different place. It prevents the cron request from spawning for zombie blogs, but still allows wp-cron.php to be called directly.
Still a bit new to the cron code. Is this right?
Cribbing from ms_site_check(), the conditions to check:
Or from get_blogs_of_user():
if ( $blog->archived || $blog->spam || $blog->deleted ) return;