https://bz.mercurial-scm.org/show_bug.cgi?id=5719

            Bug ID: 5719
           Summary: ctrl-c during `hg push` managed to leave abandoned
                    transaction on a remote repo (possibly bitbucket
                    specific)
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzi...@mercurial-scm.org
          Reporter: h...@pewpew.net
                CC: mercurial-devel@mercurial-scm.org

Note: this is possibly bitbucket specific, I have not attempted to reproduce.

TL;DR: I tried to `hg push -f`, realized I wanted to `hg push -f -r .`, hit
Ctrl-C to cancel the original command, and ended up with an abandoned
transaction *on the remote repo* that I couldn't clean up.


Setup:
≻ hg version -v
Mercurial Distributed SCM (version 4.3.3+994-4dc8a2ee0f4f)
(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2017 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Enabled extensions:

  backups        external  
  morestatus     external  
  chistedit      external  
  google_hgext   external  2017.10.11.00
  narrowhg       external  0.1
  remotefilelog  external  
  evolve         external  6.8.0.dev
  patience       external  
  blackbox       internal  
  multidiff      external  
  pdb_interrupt  external  
  extdiff        internal  
  histedit       internal  
  patchbomb      internal  
  absorb         external  
  graphlog       internal  
  rebase         internal  
  record         internal  
  shelve         internal  
  transplant     internal  

Here's a filtered version of my `hg config` output (removed all the templates,
irrelevant aliases, merge-tools, etc. stuff):

commands.status.relative=True
diff.git=yes
experimental.bundle2.pushback=True
experimental.changegroup3=True
experimental.updatecheck=noconflict
experimental.bundle2-exp=True
experimental.evolution=['all']
extensions.backups=
extensions.morestatus=
extensions.chistedit=
extensions.google_hgext=
extensions.narrowhg=
extensions.remotefilelog=
extensions.evolve=
extensions.patience=~/src/hg/extensions/patience/patience.py
extensions.blackbox=
extensions.hgext.multidiff=~/.hgext/multidiff.py
extensions.hgext.pdb_interrupt=~/.hgext/pdb_interrupt.py
extensions.extdiff=
extensions.histedit=
extensions.patchbomb=
extensions.absorb=
extensions.graphlog=
extensions.progress=
extensions.rebase=
extensions.record=
extensions.shelve=
extensions.transplant=
extensions.nointerrupt=!
hooks.preupdate.readonlysymlink=<function preupdatehook at 0x7f7f7c362050>
hooks.update.readonlysymlink=<function updatehook at 0x7f7f7c35ef50>
hooks.pretxnchangegroup.fig_requirement=<function changegrouphook at
0x7f7f7c2bf758>
hooks.update.prefetch=<function wcpprefetch at 0x7f7f7d863f50>
hooks.commit.prefetch=<function wcpprefetch at 0x7f7f7d863f50>
morestatus.show=True
pager.pager=less -FrX
paths.default=ssh://h...@bitbucket.org/facebook/hg-experimental
paths.default-push=ssh://h...@bitbucket.org/spectral54/hg-experimental
phases.publish=false
trusted.users=root
ui.supportcontact=http://go/fig-bug
ui.color=auto
ui.rollback=False
ui.interface=curses
ui.editor=vim -X
ui.username=Kyle Lippincott <spect...@google.com>
ui.merge=vim_1pane
ui.mergemarkers=detailed
ui.diff=vimdiff
ui.ssh=ssh -C
ui.ignore=~/.hgignore
ui.paginate=False

I have a bitbucket fork at http://bitbucket.org/spectral54/hg-experimental
(forked from http://bitbucket.org/facebook/hg-experimental).  This fork, as
well as the upstream repo, has evolve enabled.

I have the following graph:
@  3551:fe313cd2 spectral tip @
|  basepack: do not keep fd open
| o  3549:f23f3939 spectral
| |  basepack: close files after mmap if we never need to remap
| o  3548:22cb1670 spectral
|/   basepack: don't re-mmap if re-reading the same data makes pagedin >
MAXPAGEDIN
o  3540:6a9de6c2 quark
:  cdatapack: do not keep fd open
<lots of other stuff>

I wanted to push 3551 as a new head, so I did `hg push -f`, realized it would
push the "lots of other stuff" as well, and hit Ctrl-C.  I've trimmed the
output a bit, since I wrote an extension that dumps me into pdb if I hit
Ctrl-C, and then I hit Ctrl-D to exit pdb.  I don't think this is relevant, but
it might be.  With that removed from the output, the output looks like:

≻ hg push -f
pushing to ssh://h...@bitbucket.org/spectral54/hg-experimental
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
^C


Alright, now I wanted to do `hg push -f -r .`:

≻ hg push -f -r .
pushing to ssh://h...@bitbucket.org/spectral54/hg-experimental
searching for changes
remote: abort: abandoned transaction found!
remote: (run 'hg recover' to clean up transaction)
abort: stream ended unexpectedly (got 0 bytes, expected 4)

≻ hg recover
no interrupted transaction available


... and this persisted until someone from bitbucket was able to go clean up the
transaction on the remote side.


I don't think it should be possible to break a remote repository in a way that
requires someone to go to that remote repository and run a command.  I *do*
have a lot of experimental stuff enabled, including odd extensions.  Again, I
have *not* tried to reproduce, either on bitbucket or without bitbucket. 
Filing now, here, since #mercurial said I probably should. :)  I'll probably
also be filing against bitbucket.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to