-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Assertion failed in coroutine #847
Comments
I improved the assertion message in 61e50f3. Can you report the message when it happens again. |
That's what I get on the latest version of gitsigns |
For what it's worth, that's editing the same file that I was recreating the issue on earlier. It's a file that already exists in source control and I've just updated some lines (edited a few, added a few). The line 2308 that it's outputting there is a line that I've edited. |
Gitsigns doesn't think this file is maintained in git for whatever reason (due to This will come from when Gitsigns run |
Hmm that's strange, do you believe it's not an issue with gitsigns then?
So I can see that Also, just realised that I didn't include this in the first issue, but I can recreate this very easily when I have to separate files open in two panes (split vertically but I haven't tried any other way). |
It could be, but it's hard to tell. There could be a race condition. Without a reliable way to repro this, I'm not sure what to suggest. |
From casual observation this error seems to happen to me when switching out of (or perhaps back to) the tmux tab where I'm running neovim. If it's the result of something I'm doing while tabbed away, I haven't noticed a pattern. It's extremely intermittent in all cases. |
happens to me frequently as well |
I tend to see this issue happen when I do some git-related calls outside of nvim in another tmux window - for example reverting changes or some other index-based operations. If you use stacked git, it appears to happen a lot if you use it to insert changes into another commit -- this operation presumably involves rapidly stashing/reverting and re-applying of changes. |
This is interesting. I do use Lazygit in another tmux window, so that might be affecting it. I'm going to run a temporary branch (https://github.com/scallaway/gitsigns.nvim/tree/temp-fix-assertion) for a while to see if anything else badly breaks. Given as far as I can tell that's the line that is complaining the entire time. |
using lazygit and doing reverts, stashes ... something like that where the index changes seems to trigger it. Some kind of 'rug-pull' where the file goes from being in a modified state to not? |
I just want to point out no one has yet to provide the output of debug messages when this error occurs. The debug messages should indicate what commands for each buffer is being issued as well as whenever the gitdir watcher triggers. |
I don't know if this will fix the issue but #869 should fix some related problems around certain kinds of 'rug-pulls'. I would appreciate if anyone facing this issue could test this and report back. |
I've just pulled the following logs out now that I've been able to see it happen a few times. Note that file names are redacted.
For context, this only seems to happen in the pane that contains a Python file. I had two vertical panes setup, one with a JSX file and one with a Python file. I can't remember which one was focused (as I was tabbed out). |
Redacting all filenames to
My only guess is that the information of |
I've updated #869 with some changes to how the watcher is debounced. If anyone sees this issue with this PR applied, then please report the debug messages. Please refrain from any further "me too!" comments. |
👍 I'll run that PR from right now |
Any issues yet? |
I keep meaning to come back to this - I just haven't had time this week. I am still seeing issues (and can see you merged the PR into the base branch) but I want to try and find another good recreation to get you the info that you require |
Does this help?
|
What was the error? |
Heya, I just wanted to say that I haven't seen this error recently and the hunks status in nvim seems to update more seamlessly when I do things in lazygit. So for me, it seems to be a lot better. |
Managed to capture it just as it happened, this is what I see Although this still isn't truly reproducable. Takes ages to find the error as I'm not always working with Python either. Fwiw, this happened in TSX/JSX files only:
Edit: Realised that the first copy/paste was trash and found another one so replaced it |
This comment has been minimized.
This comment has been minimized.
Is this still an issue? I am yet to encounter this. |
Since I'm reproducing this from time to time, I could add a print() before the assert with a if inverting the assert condition, and I could print anything. I currently added one printing the whole hunk, not just the first line. If there's something that I could print out that could help you, let me know. |
So the gitsigns code in the stack trace should only be triggered by a |
I got it again. because previously I was afraid that I may have pasted two stacks from two different errors that would have happened in succession, I'll now paste the screenshot of exactly what's appearing on screen and this is now with 035da03 this was also from diffview, but this time no diffview in the stack. |
Ok that looks more normal. And is probably some race condition. The Maybe the debounce isn't long enough? |
Right now my computer was under a bit of load. diffview can also sometimes get really quite slow. I think something is keeping the neovim event loop busy, not sure what. Maybe communication with the LSP. So yes, it could be something like that. I'll search for the constant and try increasing it. |
@emmanueltouzery can you try #1008 . Hopefully that should fix it. |
great! I updated to that version and i'll report if i still get the error! 🤞 |
FYI, I'm definitely seeing some pathological performance issues on my system right now.
let's say my system absolutely exacerbates what is otherwise a real issue. maybe i should run some EDIT:
to be clear, these operations run instantly otherwise. presumably git lock contention due to too many concurrent git invocations from one or the other neovim plugin. |
There could definitely be contention, especially if you have lots of buffers open. I've added I believe to avoid the bug, Gitsigns needs to be able to run these two commands without any interference from other plugins or processes: # This tells us the object name of the tracked version of `<path>`. We use this to determine whether the file is tracked or not.
git ... ls-files --stage --others --exclude-standard --eol <path>
# This gets us the contents of tracked version of <path> in the index.
git ... --git-dir <gitdir> show :0:<path> If anything interferes with that, then that error can appear, since the information from each command won't be in sync. |
i think the no-optional-locks help. it feels less sluggish. but it's had to judge. i'll report if i see the assertion again. |
maybe only interesting for me, but... i now wonder whether i got myself in trouble with git performance due to diffview leaving hidden buffers behind sindrets/diffview.nvim#477 I can't be sure, i'll pay attention in the future. But I do run diffview a lot. It's possible it left behind a bunch of unlisted buffers and that gitsigns attached to them and that that got me in trouble. And I didn't think of checking for unlisted buffers previously. I'll pay attention in the future. EDIT: aha, but unlisted buffers are unloaded/deleted.. presumably gitsigns wouldn't attach to them 🤔 |
The only way to know would be to look at the Gitsigns cache. |
- diffview, 0.10 deprecations - gitsigns, lewis6991/gitsigns.nvim#847 - devdocs, luckasRanarison/nvim-devdocs#60
Description
This is very similar to #814, but happening in a slightly different part of
hunks.lua
.I can't work out quite when this crash happens, but I've found it to happen pretty consistently in a Python file that is open for a minute or so. Of course when the error shows, the git signs completely vanish.
I had a run through the
hunks.lua
file and found theassert
thats failing. I commented it out and had a play around with the minimum config again and that seems to do the job, but I can't be sure that's not absolutely required in the plugin.Neovim version
nightly
Operating system and version
debian
Expected behavior
No response
Actual behavior
Error output is the following;
Minimal config
Steps to reproduce
nvim --clean -u minimal.lua
Gitsigns debug messages
No response
The text was updated successfully, but these errors were encountered: