stable
Clone or download
Read-only
request #14438: Reschedule failed async events with an exponential backoff
Currently when an async event fail to be processed it is added back in queue as soon as possible. This does not maximize the chance of a success if the failure is caused by a transient error like a network issue. Some delay should be put between each rescheduling of the task. The usual way to deal with that when remote service might involved is to use an exponential backoff algorithm [0]. [0] https://en.wikipedia.org/wiki/Exponential_backoff Change-Id: I2c17539a17b5a294d9a4bd22bc4c13702523edbe
Modified Files
Name | ||||
---|---|---|---|---|
M | src/common/Queue/QueueFactory.php | +11 | −1 | Go to diff View file |
A | src/common/Queue/Redis/BackOffDelayFailedMessage.php | +68 | −0 | Go to diff View file |
A | src/common/Queue/Redis/CannotDelayMessageThatHasNotBeenQueuedException.php | +33 | −0 | Go to diff View file |
A | src/common/Queue/Redis/EventMessageForPersistentQueue.php | +34 | −0 | Go to diff View file |
M | src/common/Queue/Redis/RedisEventMessageForPersistentQueue.php | +1 | −1 | Go to diff View file |
M | src/common/Queue/Redis/RedisPersistentQueue.php | +9 | −4 | Go to diff View file |
A | tests/phpunit/common/Queue/Redis/BackOffDelayFailedMessageTest.php | +102 | −0 | Go to diff View file |