Commit 0e8c594
SPY-161: Cascade op cancellations.
Motivation
----------
When an operation is redistributed (be it because of reconnects
and/or "not my vbucket" responses, it gets cloned. The problem
is that the initial callback always points to the original
operation, not the cloned one. While the clone gets the callback,
the other way round (like cancelling from user-code) will never
trickle through to the cloned ops.
Modifications
-------------
In order to fix this issue, code has been added which connects
the original op with the cloned ones, by keeping a list of
cloned operations in the original op. To prevent overly long
stack in malicious scenarios, an overall clone-cap of 100
clones is introduced. If this cap is reached, the operation
will not be cloned further but cancelled.
Result
------
With this modifications, timeouts and cancellations from user code
will trickle through to the clone operations, prevent issues when
cloned operations are around "forever".
Change-Id: I304534a62202b705d78ca5f775f47afcd6be238a
Reviewed-on: http://review.couchbase.org/34883
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>1 parent 60b83de commit 0e8c594
3 files changed
Lines changed: 81 additions & 0 deletions
File tree
- src/main/java/net/spy/memcached
- ops
- protocol
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
992 | 998 | | |
993 | 999 | | |
994 | 1000 | | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
995 | 1008 | | |
996 | 1009 | | |
997 | 1010 | | |
| |||
1011 | 1024 | | |
1012 | 1025 | | |
1013 | 1026 | | |
| 1027 | + | |
| 1028 | + | |
1014 | 1029 | | |
1015 | 1030 | | |
1016 | 1031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
168 | 187 | | |
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
| 30 | + | |
29 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| |||
98 | 115 | | |
99 | 116 | | |
100 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
101 | 126 | | |
102 | 127 | | |
103 | 128 | | |
| |||
193 | 218 | | |
194 | 219 | | |
195 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
196 | 229 | | |
197 | 230 | | |
198 | 231 | | |
| |||
228 | 261 | | |
229 | 262 | | |
230 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
231 | 278 | | |
0 commit comments