Skip to content
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

Check why running nested consult-ripgreps do not work #272

Closed
minad opened this issue Apr 12, 2021 · 8 comments
Closed

Check why running nested consult-ripgreps do not work #272

minad opened this issue Apr 12, 2021 · 8 comments

Comments

@minad
Copy link
Owner

minad commented Apr 12, 2021

When starting multiple long running consult-ripgreps in recursive minibuffers it does not work for some reason with Vertico. Display update issue? Some state is not isolated well enough?

@jakanakaevangeli
Copy link
Contributor

I tried and couldn't reproduce (with Vertico and Selectrum). Has this been fixed?

@minad
Copy link
Owner Author

minad commented Apr 27, 2021

No idea, theoretically this should work. But when I tried it quickly a while ago it didn't work. I have to give it another check.

@minad
Copy link
Owner Author

minad commented Apr 27, 2021

I am still seeing the issue. When starting nested long running ripgreps the Minibuf-1 process happily sends its results but the Minibuf-2 process does not send anything until the Minibuf-1 process finished.

@jakanakaevangeli
Copy link
Contributor

jakanakaevangeli commented Apr 27, 2021 via email

@minad
Copy link
Owner Author

minad commented Apr 27, 2021

The problem is simply that outer minibuffers
aren't refreshed.

Exactly. I think the throttle timer works for the outer session but no ripgrep results arrive in the :filter function.

the fact that the output from inner ripgrep wasn't accepted by Emacs until the outer ripgrep exited.

Okay, you found out the same as I did.

I'm guessing that its output isn't accepted because Emacs is too busy accepting outer ripgrep's output.

I was guessing that too. But with your slowed down program this should not be the case. What kind of inefficient event mechanism is Emacs using for this - polling? There are plenty of efficient mechanisms select, kqueue on bsds, epoll on linux.

However it should be quite common to have multiple async processes running. I guess the problem must lie with the recursive editing session since another event loop is started when another minibuffer is entered recursively. The process handling must happen in this loop and the problem lies there. For a single running ripgrep the load isn't 100%, is it?

@jakanakaevangeli
Copy link
Contributor

jakanakaevangeli commented Apr 27, 2021 via email

@minad
Copy link
Owner Author

minad commented Apr 27, 2021

After running its process filter it checks whether the first process's
output is available and runs its process filter again. As its output is
never unavailable due to ripgrep's speed, Emacs never gets the chance to
check availability of the second process's output.

Sounds like a bug to me. There should be some round robin scheduling here. But this is plausible. Maybe the problem is that I am using my own filter function and the problem would go away if the output is written to a buffer which is then processed? Maybe the filter can also be optimized. consult--async-process is one of the messier parts of Consult, which should be cleaned up (PR welcome ;)

@minad
Copy link
Owner Author

minad commented Apr 30, 2021

I reported the bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants