##// END OF EJS Templates
bundle2: ignore errors seeking a bundle after an exception (issue4784)...
Gregory Szorc -
r32024:ad41739c default
parent child Browse files
Show More
@@ -354,9 +354,19 b' def processbundle(repo, unbundler, trans'
354 for nbpart, part in iterparts:
354 for nbpart, part in iterparts:
355 _processpart(op, part)
355 _processpart(op, part)
356 except Exception as exc:
356 except Exception as exc:
357 for nbpart, part in iterparts:
357 # Any exceptions seeking to the end of the bundle at this point are
358 # consume the bundle content
358 # almost certainly related to the underlying stream being bad.
359 part.seek(0, 2)
359 # And, chances are that the exception we're handling is related to
360 # getting in that bad state. So, we swallow the seeking error and
361 # re-raise the original error.
362 seekerror = False
363 try:
364 for nbpart, part in iterparts:
365 # consume the bundle content
366 part.seek(0, 2)
367 except Exception:
368 seekerror = True
369
360 # Small hack to let caller code distinguish exceptions from bundle2
370 # Small hack to let caller code distinguish exceptions from bundle2
361 # processing from processing the old format. This is mostly
371 # processing from processing the old format. This is mostly
362 # needed to handle different return codes to unbundle according to the
372 # needed to handle different return codes to unbundle according to the
@@ -370,7 +380,13 b' def processbundle(repo, unbundler, trans'
370 replycaps = op.reply.capabilities
380 replycaps = op.reply.capabilities
371 exc._replycaps = replycaps
381 exc._replycaps = replycaps
372 exc._bundle2salvagedoutput = salvaged
382 exc._bundle2salvagedoutput = salvaged
373 raise
383
384 # Re-raising from a variable loses the original stack. So only use
385 # that form if we need to.
386 if seekerror:
387 raise exc
388 else:
389 raise
374 finally:
390 finally:
375 repo.ui.debug('bundle2-input-bundle: %i parts total\n' % nbpart)
391 repo.ui.debug('bundle2-input-bundle: %i parts total\n' % nbpart)
376
392
@@ -688,7 +688,8 b' Server stops sending after bundle2 part '
688 adding changesets
688 adding changesets
689 transaction abort!
689 transaction abort!
690 rollback completed
690 rollback completed
691 abort: stream ended unexpectedly (got 0 bytes, expected 4)
691 abort: HTTP request error (incomplete response)
692 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
692 [255]
693 [255]
693
694
694 $ killdaemons.py $DAEMON_PIDS
695 $ killdaemons.py $DAEMON_PIDS
@@ -717,7 +718,8 b' Server stops after bundle2 part payload '
717 adding changesets
718 adding changesets
718 transaction abort!
719 transaction abort!
719 rollback completed
720 rollback completed
720 abort: stream ended unexpectedly (got 0 bytes, expected 4)
721 abort: HTTP request error (incomplete response)
722 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
721 [255]
723 [255]
722
724
723 $ killdaemons.py $DAEMON_PIDS
725 $ killdaemons.py $DAEMON_PIDS
@@ -747,7 +749,8 b' Server stops sending in middle of bundle'
747 adding changesets
749 adding changesets
748 transaction abort!
750 transaction abort!
749 rollback completed
751 rollback completed
750 abort: stream ended unexpectedly (got 0 bytes, expected 4)
752 abort: HTTP request error (incomplete response)
753 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
751 [255]
754 [255]
752
755
753 $ killdaemons.py $DAEMON_PIDS
756 $ killdaemons.py $DAEMON_PIDS
General Comments 0
You need to be logged in to leave comments. Login now