fix: keep delivering inverse search past an unreachable server - #3301
Merged
Conversation
The try/catch around sockconnect() does not cover the rpcnotify() and chanclose() that follow it. When a server in the log is gone, the catch swallows the connection failure and l:socket is then either undefined, raising E121, or still holds the previous iteration's closed channel. Either way the error leaves the loop and is caught by the outer try in inverse_search_cmd(), so delivery stops at the first unreachable server and every server listed after it is skipped. s:nvim_prune_servernames() keeps the log tidy, but it only runs when a tex buffer initialises, so an instance that exits between prunes leaves exactly this state: one dead entry, and inverse search silently doing nothing in every still-running instance registered after it. The pruning function twenty lines below already uses the correct shape, with its add() and chanclose() inside the try.
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
s:inverse_search_cmd_nvim, thetry/catchcoverssockconnect()but not therpcnotify()andchanclose()that follow:When a server in the log is no longer reachable, the
catchswallows the connection failure andl:socketis then either undefined, raisingE121, or still holding the previous iteration's closed channel. Either way the error leaves the loop and is caught by the outertryininverse_search_cmd(), so delivery stops at the first unreachable server and every server listed after it is skipped.s:nvim_prune_servernames()keeps the log tidy, but it only runs fromvimtex#view#init_buffer(), so an instance that exits between prunes leaves exactly this state: one dead entry in the log, and inverse search silently doing nothing in every still-running instance registered after it.Reproducing
kill -9so its socket is not pruned from the log.The change
One
continuein thecatch, which skips a server that cannot be connected and leaves the rest of the loop to run. This matches the shapes:nvim_prune_servernames()already uses twenty lines below, whereadd()andchanclose()are inside thetry.No test is included: the failure needs two Neovim instances and a socket that dies between prunes, which I could not express in the existing
test/harness. Happy to add one if you can point me at the right pattern.