I've recently added Ultimate Cron to an existing project with a number of Cron & Queue tasks. Testing went great in my local dev environment, OS X 10.11, running the built-in Apache service. But when I moved the changes to our Testing environment, running Apache on Debian, my Watchdog log began to very quickly fill up with the following PHP notice:

Notice: ob_end_flush(): failed to delete buffer zlib output compression in ultimate_cron_poorman_page_flush() (line 187 of /var/www/sites/all/modules/contrib/ultimate_cron/ultimate_cron.poorman.inc).

I truncated the watchdog table once, and within the span of five minutes, I ended up with ~150,000 instances of the PHP notice. I'd love to be able to use Ultimate Cron, and would prefer to help out with this issue rather than go roll my own, but I'm not entirely certain what's going on here. If someone can point me in the right direction, I will take a crack at fixing it.

Thanks!

Comments

classic.deeter created an issue. See original summary.

deetergp’s picture

And the really peculiar thing is that this is coming from functions around poorman's cron, on a system where poorman's cron is disabled. We have a Jenkins instance that runs our cron jobs every 15 minutes, obviating the need for Poorman's.

deetergp’s picture

I've unravelled one mystery regarding why poormanscron was firing in spite of it seeming disabled. Regardless of what settings you had for Drupal's default poormanscron, when you install Ultimate Cron, it enables its own poormanscron out of the box. Hence the reason why a function from ultimate_cron.poorman.inc was being fired and wreaking havoc on watchdog. Once I discovered its settings page at admin/config/system/cron/settings/poorman and changed the launcher from "Serial" to "--Disabled--", we ceased to see the PHP notice regarding ob_end_flush() not being able to delete buffers with zlib compression.

While this does not address the root cause of the issue, it does at least side-step them for our needs. Going to leave this ticket open.

deetergp’s picture

I'm submitting a patch that makes the assumption that if a site owner has manually disabled Drupal's poormanscron implementation, there's a good change that they aren't going to want Ultimate Cron's poormanscron implementation automatically enabled by default. This patch checks to see if cron_safe_threshold is set to 0 and if it is, disables UC's poormanscron.

deetergp’s picture

Assigned: Unassigned » deetergp
Status: Active » Needs review
deetergp’s picture

No sooner than I submitted that last patch, did I discover some issues with it. For whatever reason, variable_get('cron_safe_threshold') always returns 0, regardless of what's actually in the variable table. I refactored the patch to use db_query() instead.

mgbellaire’s picture

Looks like coding style is good, and I did test this on a vanilla Drupal installation where the variable is indeed not in the variables table, so it makes sense why the db_query is there instead of just using variable_get. If this were to be added to the module, I don't see any other cause for concern on the functionality.

Great looking patch, @deetergp!

Chris Charlton’s picture

Checkout out the patch as well; looks fine.

  • arnested committed 78ee499 on 7.x-2.x authored by deetergp
    Issue #2700625 by deetergp: Watchdog filling up with PHP notices
    
arnested’s picture

Status: Needs review » Fixed

Added to the 7.x-2.x branch. Thank you for your contribution!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.