-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concurrency bug with import git refs
#3747
Comments
This bug immediately happened to me again after I did another rebase. See https://ilya.gr/share/jj-bug-20240523-2.tar.gz (another 50MB file), this instance has fewer distracting and irrelevant file conflicts. This time, there was no internal error, the problematic operation looked like: $ # We are at operation cbead13cef3d in the op log below
$ jj rebase -s ilya -d all:ilya-~uvy
Rebased 8 commits
Existing conflicts were resolved or abandoned from these commits:
luowyr hidden 4d76830 (conflict) XProtectService
xyzpyr hidden 5e42bc2 (conflict) globs
sklqvk hidden 0a7e957 (conflict) docs `branches.md`: discuss forgetting branch after `jj branch untrack`
mrxkrt hidden e0e1f3a (conflict) forget v2
pkszrm hidden 9272272 (conflict) overview of `branch delete` and `branch forget`
ulqyqn hidden dda0739 (conflict) push and tracking
Working copy now at: vwvmrw 505c3f2 (empty) (no description set)
Parent commit : toztnq 685d727 ilya*| (empty) Merge of features I use
Added 1 files, modified 11 files, removed 1 files There was also a transient message in the watch window on a subsequent
I have one more older example, but it's ~417MB: https://drive.google.com/file/d/15oWQUrVBtGsOFDPMCnkkzq9uvVrgXoZY/view?usp=drive_link |
As I said before, git import/export and jj's In the first example,
Perhaps, the main problem here is that |
Perhaps, the original intent was to abandon non-empty working-copy commit assuming it was rewritten by git (therefore it should be superseded by the current working-copy content.) However, there are other reasons that could make the HEAD out of sync (including concurrent jj operations), and abandoning non-empty commit can be a disaster. This patch turns it to safer side, and let user abandon non-empty commit manually. Fixes jj-vcs#3747
Description
I see this bug recurrently, about once in a couple of weeks.
jj git import
sometimes messes up the repo sometimes if it runs concurrently with other operations (which happens because I have an analogue ofwatch "jj diff -s && jj log --ignore-working-copy"
running in a tmux pane continuously). I think the "other operation" was a rebase in almost all cases.I am using
watchman
; I'm unsure whether that matters.Workaround: So far, I've always been able to work around the bug by
jj op restore before_conflicting_operations
and then repeating the operation that went wrong.I finally succeeded in recording a reproduction of a reasonable size for it. You can get the repo at https://ilya.gr/share/jj-bug-20240523.tar.gz (~50MB)
The operation log looks as follows. In between
d860
and35ae
, I ran a singlejj rebase
operation. At the same time, ajj diff
operation was run bywatch
. Afterjj
resolved the concurrent operations (operation35ae
), the result was a mess.The rest of the op log is me recovering from the bug:
jj op restore
and repeating the rebase.The transcript is as follows. The "Internal error" is a consequence of the bug, but I've experienced the bug many times without an internal error.
Here's a demo of some craziness at the buggy operation 35ae. The conflicts inside the commits are expected, but the branch conflict is a bug.
The expected situation would have been:
Here's an attempt of showing what the buggy "import git refs" operation did using @bnjmnt4n 's #3617 (thank you!):
Specifications
jj 0.17.1+20240516-eb80305f23be32a6
, slightly custom binary from a week ago. (But I've been seeing this bug recurrently for ~a couple of months)The text was updated successfully, but these errors were encountered: