Commit 8cc7785
committed
As per celery#5605, the Consul backend does not cleanly associate responses
from Consul with the outbound Celery request that caused it. This leaves
it prone to mistaking the (final) response from an operation N as the
response to an (early) part of operation N + 1.
This changes fix that by using a separate connection for each request.
That of course has the downside of (a) being relatively expensive and (b)
increasing the rate of connection requests into Consul:
- The former is annoying, but at least the backend works reliably.
- The latter can cause Consul to reject excessive connection attempt, but
if it does, at least it returns a clear indication of this (IIRC, it
responds with an HTTP 429"too many connections" indication).
Additionally, this issue can be ameliorated by enabling retries in the
python-consul2 (which I believe should be turned on regards less to handle
transient network issues). This is fixed by the PR in
https:/github.com/poppyred/python-consul2/pull/31.
Note that we have never seen (b) outside a test specifically trying to hammer
the system, but we see (a) all the time in our normal system tests.
To opt-out from the new behaviour add a parameter "one_client=1" to the
connection URL.1 parent 117cd9c commit 8cc7785
2 files changed
+30
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
50 | | - | |
51 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
52 | 69 | | |
53 | 70 | | |
54 | 71 | | |
| |||
58 | 75 | | |
59 | 76 | | |
60 | 77 | | |
61 | | - | |
| 78 | + | |
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
| |||
84 | 101 | | |
85 | 102 | | |
86 | 103 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
90 | 108 | | |
91 | 109 | | |
92 | 110 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 111 | + | |
96 | 112 | | |
97 | 113 | | |
98 | 114 | | |
99 | 115 | | |
100 | | - | |
| 116 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments