diff --git a/src/allmydata/immutable/downloader/share.py b/src/allmydata/immutable/downloader/share.py
index 95173ae..1918d90 100644
a
|
b
|
class Share: |
52 | 52 | self._dyhb_rtt = dyhb_rtt |
53 | 53 | # self._alive becomes False upon fatal corruption or server error |
54 | 54 | self._alive = True |
| 55 | self._loop_scheduled = False |
55 | 56 | self._lp = log.msg(format="%(share)s created", share=repr(self), |
56 | 57 | level=log.NOISY, parent=logparent, umid="P7hv2w") |
57 | 58 | |
… |
… |
class Share: |
164 | 165 | break |
165 | 166 | else: |
166 | 167 | self._requested_blocks.append( (segnum, set([o])) ) |
167 | | eventually(self.loop) |
| 168 | self.schedule_loop() |
168 | 169 | return o |
169 | 170 | |
170 | 171 | def _cancel_block_request(self, o): |
… |
… |
class Share: |
184 | 185 | return self._requested_blocks[0] |
185 | 186 | return None, [] |
186 | 187 | |
| 188 | def schedule_loop(self): |
| 189 | if self._loop_scheduled: |
| 190 | return |
| 191 | self._loop_scheduled = True |
| 192 | eventually(self.loop) |
| 193 | |
187 | 194 | def loop(self): |
| 195 | self._loop_scheduled = False |
188 | 196 | if not self._alive: |
189 | 197 | return |
190 | 198 | try: |
… |
… |
class Share: |
797 | 805 | |
798 | 806 | def _trigger_loop(self, res): |
799 | 807 | if self._alive: |
800 | | eventually(self.loop) |
| 808 | self.schedule_loop() |
801 | 809 | return res |
802 | 810 | |
803 | 811 | def _fail(self, f, level=log.WEIRD): |