-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
projectile-find-file hanging with TRAMP #1480
Comments
Also worth pointing out that I changed I was able to get emacs up and running on the remote host to see how it operated there - projectile indexed the project in around a second. |
Does it work on small repositories? Does TRAMP work normally if you disable projectile? |
Apologies, should have included that in the initial report. TRAMP works normally even without projectile disabled - If I issue Additionally, it does work on smaller repositories. I have a project with around ~450 files in git, and projectile + TRAMP works fine on that project. Issuing |
Ok, I just noticed this: That means that If we look at your trace, we see this: (defun tramp-wait-for-output (proc &optional timeout)
"Wait for output from remote command."
(unless (buffer-live-p (process-buffer proc))
(delete-process proc)
(tramp-error proc 'file-error "Process `%s' not available, try again" proc))
(with-current-buffer (process-buffer proc)
(let* (;; Initially, `tramp-end-of-output' is "#$ ". There might
;; be leading escape sequences, which must be ignored.
;; Busyboxes built with the EDITING_ASK_TERMINAL config
;; option send also escape sequences, which must be
;; ignored.
(regexp (format "[^#$\n]*%s\\(%s\\)?\r?$"
(regexp-quote tramp-end-of-output)
tramp-device-escape-sequence-regexp))
;; Sometimes, the commands do not return a newline but a
;; null byte before the shell prompt, for example "git
;; ls-files -c -z ...".
(regexp1 (format "\\(^\\|\000\\)%s" regexp))
(found (tramp-wait-for-regexp proc timeout regexp1)))
.... snip ... So, basically what happens is that tramp tries to find So, it looks like a TRAMP "bug", that said maybe projectile could use something else than Does projectile even work locally on this repo? 85k files seems too much for any completion system... |
Thanks for taking a look at this - it definitely works locally - it's not the snappiest thing, but I can run Not sure if it's relevant, but using |
Yeah, it just occured to me that locally Anyway, as I said the best you can do here is make a bug report to TRAMP/Emacs. We'll see what @bbatsov has to say but I doubt changing projectile to modify this |
Oh, maybe you could try to install the latest TRAMP version to check if that was fixed before doing a bug report. If you don't plan on doing a bug report tell me I might do one myself. |
Is there a guide I can read somewhere about updating to the latest TRAMP? Is it on MELPA? Not familiar with how to update a package that came bundled with Emacs itself. I'm not opposed to opening up a bug report with TRAMP, but truthfully I have a very very very limited understanding of how any of this works (I just found out how to do the profiler for this in the comment above). |
Oh well, no there's no guide. To test latest TRAMP you have to get the source from the savannah repositories, and to make the bug report well... let's just say it's complicated (Emacs dev still lives in the CSV era reguarding its workflow). I'll try to make a bug report and report here. |
That's very much appreciated, thank you! Let me know if there's anyway I can help out going forward. |
@btoconnor: just to confirm that I understood the issue right, can you do this:
|
@btoconnor: also, is this a public repository? This could help reproduce. If not maybe the linux kernel could be one to test with... tho I can't wrap my head around this 85K files, why so much? why not split it in smaller repositories? |
Can confirm running The repo is very much not public. Unfortunately in this case, that's just the way our project works - it's a monolithic repo. |
@btoconnor: good news I got an answer (you can follow at https://lists.gnu.org/archive/html/emacs-devel/2019-12/msg00377.html). Can you test with the patch at https://lists.gnu.org/archive/html/emacs-devel/2019-12/txtrcGfaTvbOT.txt and report? |
Whoa thanks! That was way faster than I was expecting. I'm traveling today and will need to figure out how to do all this, but I should be able to find time in the next week. I'll post back here with my results, but the exchange on the list sounds very promising. Thanks for moving this forward for me! |
Btw, I didn't know but latest TRAMP is always available on ELPA, so it's easy to install the latest version. |
Ok apparently based on tests from Michael the patch should really fix your problem, I think we can close this as it does not concern projectile anymore. But please still add a comment later about your tests so I can report to the ML that your problem was fixed. |
Was just able to compile emacs (there was probably a faster way, but it worked for the job) from https://github.com/emacs-mirror/emacs which I noticed had the patch in it. It worked! Projectile was able to fetch the files within about 10 seconds, and now the files appear to be cached. Thanks for your help! |
Great news! Thanks 👍 |
Expected behavior
Running
projectile-find-file
runs over TRAMP successfully.I am running on a fairly large project, and I am fairly certain I am doing something wrong. I've enabled file caching, turned off dynamic modeline. However, still whenever I run
projectile-find-file
, emacs hangs. I've got around 85k files in the repository. I've timedgit ls-files -zco
and on the command line that takes around 8s. However, running it in emacs with projectile, I've let this run for ~20ish minutes and nothing completes.I couldn't figure out how to get a profile / trace going to showcase where the time is being spent when the projectile command is running. I got a backtrace, but it didn't appear helpful (to me) (remote host name and rootpath obscured below):
Output from time command:
This might not be projectile at all, so if someone could point me to how to generate a profile as seen here: #1232 (comment) I think I could start to narrow things down. I can also provide my configuration settings as well if that's helpful.
Actual behavior
When I run
projectile-find-file
over a TRAMP session, it hangs for minutes. I have not received a result yet, and the CPU goes to 100%Steps to reproduce the problem
Running
projectile-find-file
on a remote project over ssh.This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.
Environment & Version information
Projectile version information
20191204.1451
Emacs version
26.3
Operating system
OSX
The text was updated successfully, but these errors were encountered: