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

distant spawn -- rg hangs and never returns #176

Closed
fabiomcosta opened this issue May 6, 2023 · 8 comments
Closed

distant spawn -- rg hangs and never returns #176

fabiomcosta opened this issue May 6, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@fabiomcosta
Copy link

I'm having trouble spawning an rg process... it can be a simple rg helloworld and I see that on the logs the server is properly spawning the rg process, I can also ps aux | grep rg for it and I see it, but the distant spawn call just hangs there...
If I do the same with a grep -r helloworld the process runs and returns just fine.
If I ssh into the server, I'm able to run these commands just fine and also able to see their outputs.

I looked at the distant server and client logs and I don't see anything out of the ordinary.
I was wondering if you ever faced something weird like this.

@chipsenkbeil chipsenkbeil added the bug Something isn't working label May 8, 2023
@chipsenkbeil chipsenkbeil added this to the 0.20.0-alpha.5 milestone May 8, 2023
@chipsenkbeil
Copy link
Owner

Could be related to #175.

@fabiomcosta
Copy link
Author

fabiomcosta commented May 9, 2023 via email

@chipsenkbeil
Copy link
Owner

@fabiomcosta what exactly are you running when you do the spawn? I just tried ripgrep with a simple search and it worked fine without hanging:

distant spawn -- rg 'hello' /path/to/a/dir

rg-example

@fabiomcosta
Copy link
Author

fabiomcosta commented May 12, 2023

OH interesting... if I provide a folder as the second argument it does work, but without that it just hangs.
If I run that locally without the folder path it runs properly with the CWD as the folder

So try running distant spawn -- rg 'hello' it's supposed to work, and run based on your current_dir setting, but that doesn't work for some reason.
Screenshot 2023-05-12 at 10 13 49

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented May 13, 2023

@fabiomcosta you're right, it does get stuck and I'm not seeing anything other than the process being spawned. I can see that ripgrep hasn't concluded, either. Does ripgrep do anything special when no path is provided? Read stdin or anything? I can still send stdin to the process from the spawn command, so nothing has hung in terms of communication. There must be something unexpected happening that has ripgrep stalling when first launched?

Let me try running ripgrep with the --debug or --trace flag that it provides to see if something is going on.

image

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented May 13, 2023

I'm thinking that ripgrep is blocking on stdin because of the way that it is spawned makes it think that there is stdin available.

image

This is a response from the author 5 years ago when it was hanging with emacs.

image

My guess from the log is that stdin is trying to be read because ripgrep guessed incorrectly.

@fabiomcosta
Copy link
Author

fabiomcosta commented May 13, 2023 via email

@fabiomcosta fabiomcosta closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2023
@github-actions
Copy link

github-actions bot commented Jul 6, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants