1 | 1 patch for repository zooko@tahoe-lafs.org:/home/source/darcs/tahoe-lafs/trunk: |
---|
2 | |
---|
3 | Wed Aug 18 09:43:52 MDT 2010 zooko@zooko.com |
---|
4 | * debuggery: log every event that touches Share._received (a DataSpans object) |
---|
5 | |
---|
6 | New patches: |
---|
7 | |
---|
8 | [debuggery: log every event that touches Share._received (a DataSpans object) |
---|
9 | zooko@zooko.com**20100818154352 |
---|
10 | Ignore-this: 74e39ac674fd4ee4667bc011857ed137 |
---|
11 | ] { |
---|
12 | hunk ./src/allmydata/immutable/downloader/share.py 61 |
---|
13 | |
---|
14 | self._pending = Spans() # request sent but no response received yet |
---|
15 | self._received = DataSpans() # ACK response received, with data |
---|
16 | + log.msg("%s __init__() _received spans trace = DataSpans()" % (repr(self),), level=log.CURIOUS) # _received spans trace |
---|
17 | self._unavailable = Spans() # NAK response received, no data |
---|
18 | |
---|
19 | # any given byte of the share can be in one of four states: |
---|
20 | hunk ./src/allmydata/immutable/downloader/share.py 200 |
---|
21 | self._pending.dump(), self._received.dump(), |
---|
22 | self._unavailable.dump() ), |
---|
23 | level=log.NOISY, parent=self._lp, umid="BaL1zw") |
---|
24 | + log.msg("%s loop() 0 _received spans trace .dump()" % (repr(self),), level=log.CURIOUS) # received spans trace |
---|
25 | self._do_loop() |
---|
26 | # all exception cases call self._fail(), which clears self._alive |
---|
27 | except (BadHashError, NotEnoughHashesError, LayoutInvalid), e: |
---|
28 | hunk ./src/allmydata/immutable/downloader/share.py 228 |
---|
29 | self._pending.dump(), self._received.dump(), |
---|
30 | self._unavailable.dump() ), |
---|
31 | level=log.UNUSUAL, parent=self._lp, umid="F7yJnQ") |
---|
32 | + log.msg("%s loop() 1 _received spans trace .dump()" % (repr(self),), level=log.CURIOUS) # received spans trace |
---|
33 | self._fail(Failure(e), log.UNUSUAL) |
---|
34 | except BaseException: |
---|
35 | self._fail(Failure()) |
---|
36 | hunk ./src/allmydata/immutable/downloader/share.py 240 |
---|
37 | self._pending.dump(), self._received.dump(), |
---|
38 | self._unavailable.dump() ), |
---|
39 | level=log.NOISY, parent=self._lp, umid="9lRaRA") |
---|
40 | + log.msg("%s loop 2 _received spans trace .dump()" % (repr(self),), level=log.CURIOUS) # received spans trace |
---|
41 | |
---|
42 | def _do_loop(self): |
---|
43 | # we are (eventually) called after all state transitions: |
---|
44 | hunk ./src/allmydata/immutable/downloader/share.py 337 |
---|
45 | |
---|
46 | def _satisfy_offsets(self): |
---|
47 | version_s = self._received.get(0, 4) |
---|
48 | + log.msg("%s _satisfy_offsets _received spans trace .get(0, 4)" % (repr(self),), level=log.CURIOUS) # received spans trace |
---|
49 | if version_s is None: |
---|
50 | return False |
---|
51 | (version,) = struct.unpack(">L", version_s) |
---|
52 | hunk ./src/allmydata/immutable/downloader/share.py 355 |
---|
53 | % version) |
---|
54 | offset_table_size = 6 * self._fieldsize |
---|
55 | table_s = self._received.pop(table_start, offset_table_size) |
---|
56 | + log.msg("%s _satisfy_offsets _received spans trace .pop(%s, %s)" % (repr(self), table_start, offset_table_size), level=log.CURIOUS) # received spans trace |
---|
57 | if table_s is None: |
---|
58 | return False |
---|
59 | fields = struct.unpack(">"+6*self._fieldstruct, table_s) |
---|
60 | hunk ./src/allmydata/immutable/downloader/share.py 371 |
---|
61 | self.actual_offsets = offsets |
---|
62 | log.msg("actual offsets: data=%d, plaintext_hash_tree=%d, crypttext_hash_tree=%d, block_hashes=%d, share_hashes=%d, uri_extension=%d" % tuple(fields)) |
---|
63 | self._received.remove(0, 4) # don't need this anymore |
---|
64 | + log.msg("%s _satisfy_offsets _received spans trace .remove(%s, %s)" % (repr(self), 0, 4), level=log.CURIOUS) # received spans trace |
---|
65 | |
---|
66 | # validate the offsets a bit |
---|
67 | share_hashes_size = offsets["uri_extension"] - offsets["share_hashes"] |
---|
68 | hunk ./src/allmydata/immutable/downloader/share.py 398 |
---|
69 | o = self.actual_offsets |
---|
70 | fsize = self._fieldsize |
---|
71 | UEB_length_s = self._received.get(o["uri_extension"], fsize) |
---|
72 | + log.msg("%s _satisfy_UEB _received spans trace .get(%s, %s)" % (repr(self), o["uri_extension"], fsize), level=log.CURIOUS) # received spans trace |
---|
73 | if not UEB_length_s: |
---|
74 | return False |
---|
75 | (UEB_length,) = struct.unpack(">"+self._fieldstruct, UEB_length_s) |
---|
76 | hunk ./src/allmydata/immutable/downloader/share.py 403 |
---|
77 | UEB_s = self._received.pop(o["uri_extension"]+fsize, UEB_length) |
---|
78 | + log.msg("%s _satisfy_UEB _received spans trace .pop(%s, %s)" % (repr(self), o["uri_extension"]+fsize, UEB_length), level=log.CURIOUS) # received spans trace |
---|
79 | if not UEB_s: |
---|
80 | return False |
---|
81 | self._received.remove(o["uri_extension"], fsize) |
---|
82 | hunk ./src/allmydata/immutable/downloader/share.py 407 |
---|
83 | + log.msg("%s _satisfy_UEB _received spans trace .remove(%s, %s)" % (repr(self), o["uri_extension"], fsize), level=log.CURIOUS) # received spans trace |
---|
84 | try: |
---|
85 | self._node.validate_and_store_UEB(UEB_s) |
---|
86 | return True |
---|
87 | hunk ./src/allmydata/immutable/downloader/share.py 429 |
---|
88 | hashlen = o["uri_extension"] - o["share_hashes"] |
---|
89 | assert hashlen % (2+HASH_SIZE) == 0 |
---|
90 | hashdata = self._received.get(o["share_hashes"], hashlen) |
---|
91 | + log.msg("%s _satisfy_UEB _received spans trace .get(%s, %s)" % (repr(self), o["share_hashes"], hashlen), level=log.CURIOUS) # received spans trace |
---|
92 | if not hashdata: |
---|
93 | return False |
---|
94 | share_hashes = {} |
---|
95 | hunk ./src/allmydata/immutable/downloader/share.py 454 |
---|
96 | self.had_corruption = True |
---|
97 | raise |
---|
98 | self._received.remove(o["share_hashes"], hashlen) |
---|
99 | + log.msg("%s _satisfy_share_hash_tree _received spans trace .remove(%s, %s)" % (repr(self), o["share_hashes"], hashlen), level=log.CURIOUS) # received spans trace |
---|
100 | return True |
---|
101 | |
---|
102 | def _signal_corruption(self, f, start, offset): |
---|
103 | hunk ./src/allmydata/immutable/downloader/share.py 468 |
---|
104 | block_hashes = {} |
---|
105 | for hashnum in needed_hashes: |
---|
106 | hashdata = self._received.get(o_bh+hashnum*HASH_SIZE, HASH_SIZE) |
---|
107 | + log.msg("%s _satisfy_block_hash_tree _received spans trace .get(%s, %s)" % (repr(self), o_bh+hashnum*HASH_SIZE, HASH_SIZE), level=log.CURIOUS) # received spans trace |
---|
108 | if hashdata: |
---|
109 | block_hashes[hashnum] = hashdata |
---|
110 | else: |
---|
111 | hunk ./src/allmydata/immutable/downloader/share.py 492 |
---|
112 | raise |
---|
113 | for hashnum in needed_hashes: |
---|
114 | self._received.remove(o_bh+hashnum*HASH_SIZE, HASH_SIZE) |
---|
115 | + log.msg("%s _satisfy_block_hash_tree _received spans trace .remove(%s, %s)" % (repr(self), o_bh+hashnum*HASH_SIZE, HASH_SIZE), level=log.CURIOUS) # received spans trace |
---|
116 | return True |
---|
117 | |
---|
118 | def _satisfy_ciphertext_hash_tree(self, needed_hashes): |
---|
119 | hunk ./src/allmydata/immutable/downloader/share.py 500 |
---|
120 | hashes = {} |
---|
121 | for hashnum in needed_hashes: |
---|
122 | hashdata = self._received.get(start+hashnum*HASH_SIZE, HASH_SIZE) |
---|
123 | + log.msg("%s _satisfy_ciphertext_hash_tree _received spans trace .get(%s, %s)" % (repr(self), start+hashnum*HASH_SIZE, HASH_SIZE), level=log.CURIOUS) # received spans trace |
---|
124 | if hashdata: |
---|
125 | hashes[hashnum] = hashdata |
---|
126 | else: |
---|
127 | hunk ./src/allmydata/immutable/downloader/share.py 522 |
---|
128 | raise |
---|
129 | for hashnum in needed_hashes: |
---|
130 | self._received.remove(start+hashnum*HASH_SIZE, HASH_SIZE) |
---|
131 | + log.msg("%s _satisfy_ciphertext_hash_tree _received spans trace .remove(%s, %s)" % (repr(self), start+hashnum*HASH_SIZE, HASH_SIZE), level=log.CURIOUS) # received spans trace |
---|
132 | return True |
---|
133 | |
---|
134 | def _satisfy_data_block(self, segnum, observers): |
---|
135 | hunk ./src/allmydata/immutable/downloader/share.py 534 |
---|
136 | blocklen = self._node.tail_block_size |
---|
137 | |
---|
138 | block = self._received.pop(blockstart, blocklen) |
---|
139 | + log.msg("%s _satisfy_data_block _received spans trace .pop(%s, %s)" % (repr(self), blockstart, blocklen), level=log.CURIOUS) # received spans trace |
---|
140 | if not block: |
---|
141 | log.msg("no data for block %s (want [%d:+%d])" % (repr(self), |
---|
142 | blockstart, blocklen)) |
---|
143 | hunk ./src/allmydata/immutable/downloader/share.py 647 |
---|
144 | |
---|
145 | gotta_gotta_have_it.add(0, 4) # version number, always safe |
---|
146 | version_s = self._received.get(0, 4) |
---|
147 | + log.msg("%s _desire_offsets _received spans trace .get(%s, %s)" % (repr(self), 0, 4), level=log.CURIOUS) # received spans trace |
---|
148 | if not version_s: |
---|
149 | return |
---|
150 | (version,) = struct.unpack(">L", version_s) |
---|
151 | hunk ./src/allmydata/immutable/downloader/share.py 683 |
---|
152 | if not self.actual_offsets: |
---|
153 | return |
---|
154 | UEB_length_s = self._received.get(o["uri_extension"], self._fieldsize) |
---|
155 | + log.msg("%s _desire_UEB _received spans trace .get(%s, %s)" % (repr(self), o["uri_extension"], self._fieldsize), level=log.CURIOUS) # received spans trace |
---|
156 | if UEB_length_s: |
---|
157 | (UEB_length,) = struct.unpack(">"+self._fieldstruct, UEB_length_s) |
---|
158 | # we know the length, so make sure we grab everything |
---|
159 | hunk ./src/allmydata/immutable/downloader/share.py 719 |
---|
160 | |
---|
161 | def _send_requests(self, desired): |
---|
162 | ask = desired - self._pending - self._received.get_spans() |
---|
163 | + log.msg("%s _send_requests _received spans trace .get_spans()" % (repr(self),), level=log.CURIOUS) # received spans trace |
---|
164 | log.msg("%s._send_requests, desired=%s, pending=%s, ask=%s" % |
---|
165 | (repr(self), desired.dump(), self._pending.dump(), ask.dump()), |
---|
166 | level=log.NOISY, parent=self._lp, umid="E94CVA") |
---|
167 | hunk ./src/allmydata/immutable/downloader/share.py 762 |
---|
168 | level=log.NOISY, parent=lp, umid="5Qn6VQ") |
---|
169 | self._pending.remove(start, length) |
---|
170 | self._received.add(start, data) |
---|
171 | + log.msg("%s _got_data _received spans trace .add(%s, len=%s)" % (repr(self), start, len(data)), level=log.CURIOUS) # received spans trace |
---|
172 | |
---|
173 | # if we ask for [a:c], and we get back [a:b] (b<c), that means we're |
---|
174 | # never going to get [b:c]. If we really need that data, this block |
---|
175 | } |
---|
176 | |
---|
177 | Context: |
---|
178 | |
---|
179 | [docs: doc of the download status page |
---|
180 | zooko@zooko.com**20100814054117 |
---|
181 | Ignore-this: a82ec33da3c39a7c0d47a7a6b5f81bbb |
---|
182 | ref: http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1169#comment:1 |
---|
183 | ] |
---|
184 | [docs: NEWS: edit English usage, remove ticket numbers for regressions vs. 1.7.1 that were fixed again before 1.8.0c2 |
---|
185 | zooko@zooko.com**20100811071758 |
---|
186 | Ignore-this: 993f5a1e6a9535f5b7a0bd77b93b66d0 |
---|
187 | ] |
---|
188 | [docs: NEWS: more detail about new-downloader |
---|
189 | zooko@zooko.com**20100811071303 |
---|
190 | Ignore-this: 9f07da4dce9d794ce165aae287f29a1e |
---|
191 | ] |
---|
192 | [TAG allmydata-tahoe-1.8.0c2 |
---|
193 | david-sarah@jacaranda.org**20100810073847 |
---|
194 | Ignore-this: c37f732b0e45f9ebfdc2f29c0899aeec |
---|
195 | ] |
---|
196 | Patch bundle hash: |
---|
197 | 2e142d1675bd672e059c5c9b52dc8d58ffb0e9ab |
---|