Skip to content

Repeated errors from waiting for new jobs #13

@hlubek

Description

@hlubek

With am empty queue:

Job execution for job (message: "", queue: "myQueue") failed (1/1 trials) - ABORTING
  Reason: The message "" in queue "myQueue" could not be unserialized to a class implementing JobInterface

  Type: RuntimeException
  Code: 1465901245
  File: Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Flowpack_JobQueue
        _Common_Job_JobManager.php
  Line: 146

I suspect the type change to cause an unwanted coercion to string and thus an empty message from a timeout is not detected:

    /**
     * @param string $messageId
     * @return Message
     */
    protected function getMessageById(string $messageId): ?Message
    {
        if (!is_string($messageId)) {
            return null;
        }
        $encodedPayload = $this->client->hGet("queue:{$this->name}:ids", $messageId);
        $numberOfReleases = (integer)$this->client->hGet("queue:{$this->name}:releases", $messageId);
        return new Message($messageId, json_decode($encodedPayload, true), $numberOfReleases);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions