MCPcopy Create free account
hub / github.com/wal-e/wal-e / _complete_execution

Method _complete_execution

wal_e/worker/pg/wal_transfer.py:164–192  ·  view source on GitHub ↗

Forward any raised exceptions across a channel.

(self, g)

Source from the content-addressed store, hash-verified

162 g.start()
163
164 def _complete_execution(self, g):
165 """Forward any raised exceptions across a channel."""
166
167 # Triggered via completion callback.
168 #
169 # Runs in its own greenlet, so take care to forward the
170 # exception, if any, to fail the entire transfer in event of
171 # trouble.
172 assert g.ready()
173 self.greenlets.remove(g)
174
175 placed = UserCritical(msg='placeholder bogus exception',
176 hint='report a bug')
177
178 if g.successful():
179 try:
180 segment = g.get()
181
182 if not segment.explicit:
183 segment.mark_done()
184 except BaseException as e:
185 # Absorb and forward exceptions across the channel.
186 placed = e
187 else:
188 placed = None
189 else:
190 placed = g.exception
191
192 self.wait_change.put(placed)

Callers

nothing calls this directly

Calls 4

UserCriticalClass · 0.90
getMethod · 0.80
putMethod · 0.80
mark_doneMethod · 0.45

Tested by

no test coverage detected