Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Messenger] TraceableMiddleware does not verify if Stopwatch event is started before stopping it #36762

Copy link
Copy link
Closed
@jlekowski

Description

@jlekowski
Issue body actions

Symfony version(s) affected: 4.4, 5.0, 5.1

Description
In certain cases when TraceableMiddleware is used, LogicException from Stopwatch is thrown because TraceableMiddleware tries to stop an event that is not started.

How to reproduce
Repo available here https://github.com/jlekowski/symfony-messenger-traceablemiddleware - clone and try to add and consume a message by calling messages:

php bin/console notification:send
php bin/console messenger:consume

result:

2020-05-08T15:32:49+01:00 [critical] Error thrown while handling message App\Message\Notification. Removing from transport after 0 retries. Error: "Event ""Symfony\Component\Messenger\Middleware\HandleMessageMiddleware" on "messenger.bus.default"" is not started."

Possible Solution
jlekowski@91c5dbe
Could also be:

$this->stop();

Additional context
There was no issue when redis transport was set (TraceableMiddleware was not used), or when sub-request was not used.

There is also a chance that my idea of calling sub-requests from a handler is totally wrong, but I believe $this->stopwatch->isStarted($this->currentEvent) check should be there regardless.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.