Skip to content

RedisProducer enqueued messages get inflated TTLs by incorrect handling of seconds / milliseconds #1406

Description

@nikolay-dobromirov

The line in RedisProducer

            $message->setHeader('expires_at', time() + $message->getTimeToLive());

Sums seconds + milliseconds, resulting in inflated TTLs.
I assume the expires_at is referring to the timestamp to expire at...
The 2 lines below the delivery one is divided by a 1000 to get back to seconds, when summed with time().

            $deliveryAt = time() + $message->getDeliveryDelay() / 1000;

Both are documented as milliseconds.

Seems that whatever we place in here will have a very long TTL... (by a factor of 1000). Every second of TTL is in reality a 16-17 minutes.

Is that intentional OR an issue?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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