Commit 21f8f8e
committed
feature symfony#53328 [Messenger] Add jitter parameter to MultiplierRetryStrategy (rmikalkenas)
This PR was merged into the 7.1 branch.
Discussion
----------
[Messenger] Add jitter parameter to MultiplierRetryStrategy
| Q | A
| ------------- | ---
| Branch? | 7.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | -
| License | MIT
I'm seeing an interesting case, when multiple queue consumers causes failures in a downstream systems a.k.a. [thundering herd](https://en.wikipedia.org/wiki/Thundering_herd_problem) effect.
Many jobs fail, they all get enqueued to try again in a static interval and bring down the downstream system yet again. This repeats until the retry limit is exhausted.
Introduced delay randomness prevents thundering herd effect. The randomness can be controlled via `$jitter` parameter.
~~**Open question:** I added `$jitter` parameter with a default value of `0.1` (as in [http client's generic retry](https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/HttpClient/Retry/GenericRetryStrategy.php)), but maybe it should be set as `0` to keep code in a BC fashion?~~
Commits
-------
9949684 [Messenger] Add jitter parameter to MultiplierRetryStrategyFile tree
6 files changed
+54
-3
lines changed- src/Symfony
- Bundle/FrameworkBundle
- DependencyInjection
- Resources/config
- Component/Messenger
- Retry
- Tests/Retry
6 files changed
+54
-3
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
| 1595 | + | |
1595 | 1596 | | |
1596 | 1597 | | |
1597 | 1598 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2195 | 2195 | | |
2196 | 2196 | | |
2197 | 2197 | | |
2198 | | - | |
| 2198 | + | |
| 2199 | + | |
2199 | 2200 | | |
2200 | 2201 | | |
2201 | 2202 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
85 | 97 | | |
86 | 98 | | |
87 | 99 | | |
| |||
Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
92 | 127 | | |
0 commit comments