Wait for transfer to exit, raising errors as necessary.
(self)
| 128 | self.greenlets = set([]) |
| 129 | |
| 130 | def join(self): |
| 131 | """Wait for transfer to exit, raising errors as necessary.""" |
| 132 | self.closed = True |
| 133 | |
| 134 | while self.expect > 0: |
| 135 | val = self.wait_change.get() |
| 136 | self.expect -= 1 |
| 137 | |
| 138 | if val is not None: |
| 139 | # Wait a while for all running greenlets to exit, and |
| 140 | # then attempt to force them to exit so join() |
| 141 | # terminates in a reasonable amount of time. |
| 142 | gevent.joinall(list(self.greenlets), timeout=30) |
| 143 | gevent.killall(list(self.greenlets), block=True, timeout=30) |
| 144 | raise val |
| 145 | |
| 146 | def start(self, segment): |
| 147 | """Begin transfer for an indicated wal segment.""" |