acquia_agent_subscription_is_active() calls acquia_agent_check_subscription() which invokes acquia_agent_subscription_is_active() again resulting in PHP Fatal error: Maximum function nesting level of '100' reached, aborting!

module_invoke_all() was introduced in #1009810: subscription status issue in acquia_agent_check_subscription()

I know this isn't always caused, so tracking down steps to reproduce.

Comments

coltrane’s picture

Should acquia_agent_valid_response() return FALSE then variable acquia_subscription_data isn't updated and acquia_agent_subscription_is_active() calls acquia_agent_check_subscription() again (and again)

soyarma’s picture

I think this only happens if cron hasn't been run for more than 1 day and there is an hmac error because of the condition below

    if (isset($subscription['timestamp']) && (time() - $subscription['timestamp'] > 60*60*24)) {
      $subscription = acquia_agent_check_subscription(array('no_heartbeat' => 1));
    }

I think a solution would be not to do the module_invoke_all (module_invoke_all('acquia_subscription_status', acquia_agent_subscription_is_active());) in the acquia_agent_check_subscription function if there is an hmac validation error.

coltrane’s picture

coltrane’s picture

Status: Active » Needs review
soyarma’s picture

Looks good to me

kenorb’s picture

The same problem, it happens when there is no connection. I didn't test the patch yet.

coltrane’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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