8000 [Messenger] Symfony serializer does not check all serializer failures · Issue #35446 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Messenger] Symfony serializer does not check all serializer failures #35446
Closed
@waaghals

Description

@waaghals

Symfony version(s) affected: 4.4|5.0

Description
When the serialization of a message fails a MessageDecodingFailedException should be thrown.
But this only happens for UnexpectedValueException in the transport serializer.
This means that any other exceptions from the serializer like MissingConstructorArgumentsException do not result in a MessageDecodingFailedException from the messenger transport serializer.

Because this is not the case, the worker crashes and does not reject the message. This also means that the message stays in the queue, resulting in a crash loop of the worker.

How to reproduce

  1. Create a message in the bus without a worker running.
  2. Add an extra field to the constructor of the created message
  3. Run the worker
  4. Message is not rejected because no MessageDecodingFailedException was thrown.

Possible Solution
Instead of checking for Symfony\Component\Serializer\Exception\UnexpectedValueException check for Symfony\Component\Serializer\Exception\ExceptionInterface in Symfony\Component\Messenger\Transport\Serialization\Serializer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0