ananthakumaran / monky

Magit for Hg
http://ananthakumaran.in/monky/index.html
GNU General Public License v3.0
154 stars 30 forks source link

monky-status hangs forever on large repositories #35

Closed michaelklishin closed 5 years ago

michaelklishin commented 11 years ago

With a repository like rabbitmq-server, monky-status seems to block forever until interrupted.

Magit can handle repositories as large or even larger (like the entire Emacs git mirror) just fine.

ananthakumaran commented 11 years ago

I cannot reproduce the problem. can you post the stack trace so i can better understand the problem. you can get it by M-x toggle-debug-on-quit.

michaelklishin commented 11 years ago

I do the following

Emacs spikes to 99% CPU and stays there for a few minutes with no errors in the messages buffer. I then interrupt it with M-g.

ananthakumaran commented 11 years ago

its M-x toggle-debug-on-quit and break it with C-g.

michaelklishin commented 11 years ago

Yes, I indeed used C-g, it was a typo. Sorry about that.

Here's the backtrace:

Debugger entered--Lisp error: (quit)
  accept-process-output(#<process monky-hg> 0.1 nil t)
  (while (< (point-max) size) (accept-process-output monky-cmd-process 0.1 nil t))
  (save-current-buffer (set-buffer (process-buffer monky-cmd-process)) (while (< (point-max) size) (accept-process-output monky-cmd-process 0.1 nil t)) (let ((str (buffer-substring (point-min) (+ (point-min) size)))) (delete-region (point-min) (+ (point-min) size)) (goto-char (point-min)) (vconcat str)))
  monky-cmdserver-read-data(5)
  (bindat-unpack (quote ((channel byte) (len u32))) (monky-cmdserver-read-data 5))
  (let* ((data (bindat-unpack (quote ((channel byte) (len u32))) (monky-cmdserver-read-data 5))) (channel (bindat-get-field data (quote channel))) (len (bindat-get-field data (quote len)))) (cons channel (monky-cmdserver-read-data len)))
  monky-cmdserver-read()
  (monky-cmdserver-parse-hello (monky-cmdserver-read))
  (setq monky-cmd-hello-message (monky-cmdserver-parse-hello (monky-cmdserver-read)))
  (let ((monky-cmd-process (monky-start-process "monky-hg" buf "sh" "-c" "hg --config extensions.mq= serve --cmdserver pipe 2> /dev/null"))) (set-process-coding-system monky-cmd-process (quote no-conversion) (quote no-conversion)) (set-process-sentinel monky-cmd-process (function monky-cmdserver-sentinel)) (setq monky-cmd-hello-message (monky-cmdserver-parse-hello (monky-cmdserver-read))) monky-cmd-process)
  (save-current-buffer (set-buffer buf) (setq buffer-read-only nil) (setq buffer-file-coding-system (quote no-conversion)) (set-buffer-multibyte nil) (erase-buffer) (setq view-exit-action (function (lambda (buffer) (save-current-buffer (set-buffer buffer) (bury-buffer))))) (setq default-directory dir) (let ((monky-cmd-process (monky-start-process "monky-hg" buf "sh" "-c" "hg --config extensions.mq= serve --cmdserver pipe 2> /dev/null"))) (set-process-coding-system monky-cmd-process (quote no-conversion) (quote no-conversion)) (set-process-sentinel monky-cmd-process (function monky-cmdserver-sentinel)) (setq monky-cmd-hello-message (monky-cmdserver-parse-hello (monky-cmdserver-read))) monky-cmd-process))
  (let ((dir monky-root-dir) (buf (get-buffer-create monky-cmd-process-buffer-name)) (default-directory monky-root-dir) (process-connection-type nil)) (save-current-buffer (set-buffer buf) (setq buffer-read-only nil) (setq buffer-file-coding-system (quote no-conversion)) (set-buffer-multibyte nil) (erase-buffer) (setq view-exit-action (function (lambda (buffer) (save-current-buffer (set-buffer buffer) (bury-buffer))))) (setq default-directory dir) (let ((monky-cmd-process (monky-start-process "monky-hg" buf "sh" "-c" "hg --config extensions.mq= serve --cmdserver pipe 2> /dev/null"))) (set-process-coding-system monky-cmd-process (quote no-conversion) (quote no-conversion)) (set-process-sentinel monky-cmd-process (function monky-cmdserver-sentinel)) (setq monky-cmd-hello-message (monky-cmdserver-parse-hello (monky-cmdserver-read))) monky-cmd-process)))
  monky-cmdserver-start()
  (setq monky-cmd-process (monky-cmdserver-start))
  (progn (setq monky-cmd-process (monky-cmdserver-start)))
  (if (and outer (eq monky-process-type (quote cmdserver))) (progn (setq monky-cmd-process (monky-cmdserver-start))))
  (let ((outer (not monky-cmd-process))) (if (and outer (eq monky-process-type (quote cmdserver))) (progn (setq monky-cmd-process (monky-cmdserver-start)))) (unwind-protect (progn (let* ((rootdir (or directory (monky-get-root-dir))) (buf (or (monky-find-status-buffer rootdir) (generate-new-buffer ...)))) (pop-to-buffer buf) (monky-mode-init rootdir (quote status) (function monky-refresh-status)) (monky-status-mode t))) (if (and monky-cmd-process outer (eq monky-process-type (quote cmdserver))) (progn (delete-process monky-cmd-process) (setq monky-cmd-process nil)))))
  monky-status()
  call-interactively(monky-status)
  ido-execute-command()
  call-interactively(ido-execute-command nil nil)
ananthakumaran commented 11 years ago
michaelklishin commented 11 years ago
hg --version
Mercurial Distributed SCM (version 2.6)
hg --config extensions.mq= serve --cmdserver pipe 2> /dev/null
o4capabilities: getencoding runcommand
encoding: UTF-8

(setq monky-process-type nil) indeed helps me see the buffer. *monky-cmd-process* is always blank for me.

ananthakumaran commented 11 years ago

what is your emacs version. The hg process seems to send data but for some reason accept-process-output is not reading it.

michaelklishin commented 11 years ago
(emacs-version) ;= "GNU Emacs 24.3.1 (x86_64-apple-darwin12.2.0, NS apple-appkit-1187.34)
 of 2013-03-20 on giove.local"
Bounga commented 5 years ago

This issue is old. Is it still relevant @michaelklishin ?

Wilfred commented 5 years ago

FWIW I have tried monky on some very large repos without issues.

Bounga commented 5 years ago

@Wilfred Ok I'll close this issue. If it happens again to someone we'll open a new one.