In the MessageQueueCreator class from the activity_logger module we have a workaround active that waits for 5 seconds before creating the create_entitiy_action to support nodes in groups.

On multiple occasions across multiple projects (but not regularly) we have found that the CRON was stuck and had to be killed. The cause was that the activity logger message queue was in a Infinite loop:

INSERT INTO queue (name, data, created) VALUES ('activity_logger_message', 'a:1:{s:9:\\\"entity_id\\\";s:3:\\\"206\\\";}', '1494407324')

DELETE FROM queue WHERE  (item_id = '5838349')

SELECT data, created, item_id FROM queue q WHERE expire = 0 AND name = 'activity_logger_message' ORDER BY created, item_id ASC LIMIT 0, 1"

UPDATE queue SET expire='1494407354'\nWHERE  (item_id = '5838350') AND (expire = '0')

INSERT INTO queue (name, data, created) VALUES ('activity_logger_message', 'a:1:{s:9:\\\"entity_id\\\";s:3:\\\"206\\\";}', '1494407324')

DELETE FROM queue WHERE  (item_id = '5838350')

SELECT data, created, item_id FROM queue q WHERE expire = 0 AND name = 'activity_logger_message' ORDER BY created, item_id ASC LIMIT 0, 1"

UPDATE queue SET expire='1494407354'\nWHERE  (item_id = '5838351') AND (expire = '0')

INSERT INTO queue (name, data, created) VALUES ('activity_logger_message', 'a:1:{s:9:\\\"entity_id\\\";s:3:\\\"206\\\";}', '1494407324')

We are not sure how this Infinite loop could be activated because the node with id 206 was deleted and should not get passed the if statement if ($entity = Node::load($data['entity_id'])) { but it seems it did.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nielsvandermolen created an issue. See original summary.

nielsvandermolen’s picture

This patch adds some defensive programming, that in the odd case the $diff is negative it would not continue in an infinite loop.

nielsvandermolen’s picture

Version: 8.x-1.0-rc1 » 8.x-1.x-dev
Assigned: Unassigned » jochemvn
Priority: Major » Critical
FileSize
867 bytes
40.28 KB

Found a way to reproduce it. As a CM it is possible to set an authored on date which is the created date.

When this date is set in the future the CRON task will be stuck (and the process will not abort).

There is a potential issue that an incorrect notification is being sent for nodes that are created in a group with a authored on date set in the future. But that issue is less critical than the CRON breaking.

PR:

https://github.com/goalgorilla/open_social/pull/372

jaapjan’s picture

Status: Needs review » Fixed

Thanks for the report. It has been merged and will land in the next release.

Status: Fixed » Closed (fixed)

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