-
-
Notifications
You must be signed in to change notification settings - Fork 803
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
--max-results=1 does not actually quit after the first result #867
Comments
Thank you very much. That is definitely not expected. In your case, there might be something else is going on. Could you try to run |
It doesn't really look any different before and after it prints the result, it's just |
Now that I look more closely, soon after printing the result it transitions into a huge string of |
Do we need to be telling the walker to quit scanning? |
This makes a HUGE difference:
I don't fully understand the purpose of this |
I can reproduce this. I think you're right about the cause, we're still waiting for the worker threads to finish even once the receiver thread is done. |
Btw, I was looking into testing this by hacking https://github.com/wfraser/fuse-mt/blob/master/example/src/passthrough.rs to insert a delay before all filesystem operations. More consistent (and cheaper) than hitting AWS over and over. Might be a good way to set up unit tests even. |
Thank you for reporting this.
I don't think we are waiting for the workers threads to completely finish the search, but it might be the case that some of them keep running until … well to be honest, I don't know for sure. They will definitely quit once they attempt to send something back over the MPSC channel to the receiver thread (
|
The key to reproducing this is to search for something that has only one match For example, I have only one file in my home directory called |
quit_flag is now used to quit the sender threads for any reason, either due to an interrupt or because the receiver is done. interrupt_flag is used specifically for ^C interrupts, and causes the receiver to stop between printing paths, to avoid unfinished escape sequences when colors are being used. Fixes sharkdp#867.
quit_flag is now used to quit the sender threads for any reason, either due to an interrupt or because the receiver is done. interrupt_flag is used specifically for ^C interrupts, and causes the receiver to stop between printing paths, to avoid unfinished escape sequences when colors are being used. Fixes sharkdp#867.
Describe the bug you encountered:
I am running
fd
on a slow FUSE filesystem (goofys). It seems like-1
/--max-results=1
doesn't do what it says on the tin.Describe what you expected to happen:
I expected
fd
to print the result and then quit. There is only one file on the path that matches my pattern.I ran this command:
fd -F --max-results=1 PATTERN PATH
One result is printed ~5 seconds later, but
fd
continues to run for a long time, at least a minute, until I interrupted it. FWIW,find
can search the entire path in <25 seconds.What version of
fd
are you using?Which operating system / distribution are you on?
The text was updated successfully, but these errors were encountered: