Skip to content

[Messenger] PostgreSQL: new messages are not picked up for 60 seconds #45056

Closed
@bendavies

Description

@bendavies

Symfony version(s) affected

5.3 onwards

Description

Hi,

There appears to be a bug in PostgreSqlConnection meaning that newly available messages are not picked immediately.

This is due to this line:

(microtime(true) * 1000 - $this->queueEmptiedAt < $this->configuration['check_delayed_interval'])

I really don't understand what that line is doing apart from being something to do with delayed message, but apart from that don't understand it.

How to reproduce

  1. start your consume: bin/console messenger:consume async -vvv
  2. queue some job via any means you like
  3. this message will be consumed immediately
  4. queue another message via any means you like
  5. this message and all other new ones will not be picked up for 60 seconds after the message in 2. was consumed.

Simply: after the queue is emptied, new messages will not be picked up for 60 seconds because of check_delayed_interval' => 60000

Possible Solution

Unsure, no idea what

(microtime(true) * 1000 - $this->queueEmptiedAt < $this->configuration['check_delayed_interval'])
is meant to be doing.

Additional Context

Found a related discussion #36990

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