We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 3395f608 authored by mattl's avatar mattl

Endless loop nesting on ensureHub failure now fixed

Essentially I was missing a negation on a test if we were in rediscovery mode.
parent c9a9a8bc
......@@ -216,6 +216,7 @@ class FeedSub extends Managed_DataObject
public function ensureHub($rediscovered=false)
common_debug('Now inside ensureHub again, $rediscovered=='._ve($rediscovered));
if ($this->sub_state !== 'inactive') {
common_log(LOG_INFO, sprintf(__METHOD__ . ': Running hub discovery a possibly active feed in %s state for URI %s', _ve($this->sub_state), _ve($this->uri)));
......@@ -244,7 +245,7 @@ class FeedSub extends Managed_DataObject
common_debug('Database update failed for FeedSub id=='._ve($this->id).' with new huburi: '._ve($this->huburi));
throw new ServerException('Database update failed for FeedSub.');
if ($rediscovered) {
if (!$rediscovered) {
return $result;
......@@ -447,7 +448,8 @@ class FeedSub extends Managed_DataObject
// we avoid running this part over and over and over and over):
common_debug('Running ensureHub again due to 422 status, $rediscovered=='._ve($rediscovered));
$discoveryResult = $this->ensureHub(true);
common_debug('ensureHub is now done and its result was: '._ve($discoveryResult));
} else {
common_log(LOG_ERR, __METHOD__ . ": sub req failed with HTTP $status: " . $response->getBody());
......@@ -45,7 +45,11 @@ class PushInQueueHandler extends QueueHandler
} catch(NoResultException $e) {
common_log(LOG_INFO, "Discarding POST to unknown feed subscription id {$feedsub_id}");
} catch(Exception $e) {
common_log(LOG_ERR, "Exception "._ve(get_class($e))." during WebSub push input processing for {$feedsub->getUri()}: " . $e->getMessage());
if (is_null($feedsub)) {
common_log(LOG_ERR, "Exception "._ve(get_class($e))." during WebSub push input processing where FeedSub->receive returned null!" . _ve($e->getMessage()));
} else {
common_log(LOG_ERR, "Exception "._ve(get_class($e))." during WebSub push input processing for {$feedsub->getUri()}: " . _ve($e->getMessage()));
return true;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment