This repository was archived by the owner on Jan 16, 2025. It is now read-only.
Commit 74838cc
committed
Try to fix memcached corrupted uploads
If a memcached server responds to an op before the
write of the op is completed, we can no longer trust
the parser read state of the server and we should
both abandon the op and reconnect to the server.
For example, we may be halfway through a length+blob
write. If the server rejects the op before we finish
writing, we cannot simply abandon the write and start
writing the next op, as those bytes may end up being
part of the payload of the failed op!
This situation has been observed in production (i.e.
corrupted memcached values with binary op headers in them)
and this is a best-guess at how to prevent it, but it is
difficult to reproduce without mocking a server which
produces abrupt failures.1 parent e280bef commit 74838cc
File tree
3 files changed
+24
-2
lines changed- src/main/java/net/spy/memcached
- protocol
3 files changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
813 | 816 | | |
814 | 817 | | |
815 | 818 | | |
816 | 819 | | |
817 | 820 | | |
818 | 821 | | |
819 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
820 | 826 | | |
821 | 827 | | |
822 | 828 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
202 | 210 | | |
203 | | - | |
| 211 | + | |
| 212 | + | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
| |||
0 commit comments