Skip to content

[Messenger] Symfony serializer does not check all serializer failures #35446

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy