unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18728: 24.0.50; gnus hangs while reading mail from imap server
@ 2014-10-14 22:56 tsugutomo.enami
  2014-10-15  7:59 ` Andreas Schwab
  2014-10-16 13:22 ` Ted Zlatanov
  0 siblings, 2 replies; 6+ messages in thread
From: tsugutomo.enami @ 2014-10-14 22:56 UTC (permalink / raw)
  To: 18728

Hi.

The gnus hangs while reading mail from imap server on startup, with
displaying "nnimap read NNNNNNk" in mini buffer.  The amount of NNNNNN
was about 200Mbytes.

The backtrace when debug-on-quit is set and hitting C-g is here (since
it contains raw control code, the output is passed through cat -v):

Debugger entered: ("Quit")
  byte-code("^H\203^H^@\302\303!\210\304	!\210\305\207" [debug-on-quit process debug "Quit" delete-process nil] 2)
  nnimap-wait-for-response(416 t)
  nnimap-fetch-inbox((433993 . 472075))
  nnimap-split-incoming-mail()
  nnimap-request-scan(nil "rplaca.sm.sony.co.jp")
  gnus-request-scan(nil (nnimap "rplaca.sm.sony.co.jp" (nnimap-inbox "INBOX") (nnimap-split-methods (quote nnmail-split-fancy))))
  gnus-get-unread-articles(nil)
  gnus-setup-news(nil nil nil)
  byte-code("^H\204^N^@	\204^N^@\306 \210\202L^@\307\310!\210\311\n!^S\f\204^^^@^M\203!^@\312 \210\313\314^N^X^H#\210\307\315!\210^N^Y\2036^@\316\317\320\"\210\321 \210\322^N^X!\210\323 \210\324\325!\210\326 \210\307\327!\210\314\207" [dont-connect did-connect gnus-startup-file gnus-current-startup-file gnus-slave gnus-use-dribble-file gnus-group-quit gnus-run-hooks gnus-startup-hook gnus-make-newsrc-file gnus-dribble-read-file gnus-setup-news nil gnus-setup-news-hook gnus-request-create-group "queue" (nndraft "") gnus-start-draft-setup gnus-group-list-groups gnus-group-first-unread-group gnus-configure-windows group gnus-group-set-mode-line gnus-started-hook level gnus-agent] 4)
  gnus-1(nil nil nil)
  gnus(nil)
  call-interactively(gnus t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

Last few lines of buffer named "*nnimap rplaca.sm.sony.co.jp nil
*nntpd**" is here (^M is actually a raw carrige-return code):

X-Spam-Flag: No^M
^M
)^M
416 OK Fetch completed.^M
417 OK NOOP completed.^M
418 OK NOOP completed.^M

The work around for me was adding code to ignore above NOOP lines in
nnimap-wait-for-response, as follows:

--- nnimap.el.orig	2011-06-01 09:27:58.000000000 +0900
+++ nnimap.el	2014-10-14 13:56:31.000000000 +0900
@@ -1683,7 +1689,8 @@
 			(while (and (not (bobp))
 				    (progn
 				      (forward-line -1)
-				      (looking-at "\\*"))))
+				      (or (looking-at "\\*")
+					  (looking-at "[0-9]+ OK NOOP")))))
 			(not (looking-at (format "%d .*\n" sequence)))))
 	    (when messagep
 	      (nnheader-message 7 "nnimap read %dk" (/ (buffer-size) 1000)))


I guess the NOOP lines are response for the NOOP command sent to keep a
connection.  The gnus version used here is rather old but, at a glance,
the function in upstream repository is almost same.

enami.



In GNU Emacs 24.0.50.1 (x86_64--netbsd)
 of 2011-06-01 on gco-w12f-177-176.sm.sony.co.jp
configured using `configure  'x86_64--netbsd' '--with-x=no' 'build_alias=x86_64--netbsd' 'host_alias=x86_64--netbsd' 'target_alias=x86_64--netbsd''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  file-name-shadow-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Recent input:
C-n C-n f C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p 
TAB C-p TAB C-@ ESC C-f ESC w C-x o TAB ( o r SPC ESC 
C-f ) C-b RET TAB C-y ESC C-a ESC C-f C-x C-s ESC v 
ESC v C-n C-x o C-x C-b C-x o C-n C-n C-n f ESC < RET 
RET C-p C-p * b a c k t r a c e * SPC C-x C-j q f a 
DEL DEL b a f f a C-n C-p C-v C-v C-v C-n C-n C-p C-v 
C-n C-n C-@ ESC C-f C-a C-@ C-e C-w C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p RET C-y SPC C-x C-j C-x C-j 
n o S a i g o SPC S u u g y o u SPC C-g C-j C-b C-b 
C-b C-b C-b Q C-f C-f SPC Q C-e SPC C-j C-a C-x C-s 
~ / g n u s - b u g TAB . t x t RET C-x C-s C-x 1 ESC 
> ESC v C-v ESC < C-n C-n C-n C-n C-n C-n C-n C-n C-n 
ESC C-f C-f C-b ESC C-f C-a C-x C-b C-x o C-n C-n f 
C-x 1 C-x b SPC * DEL M i TAB TAB 0 TAB C-g q C-x C-b 
C-x o ESC > ESC C-p C-p C-p C-n C-n C-n C-n C-n C-n 
C-n C-n C-p C-n C-a f C-x 1 ESC < C-v C-v C-v C-v ESC 
< ESC x e m a c s SPC v TAB RET ESC x r e p o SPC r 
TAB RET

Recent messages:
Could not activate SKK SERVER on parity-error.sm.sony.co.jp.
Wrote /home/enami/gnus-bug.txt
(No changes need to be saved)
Mark set [2 times]
Making completion list...
Entering debugger...
Back to top level.
Mark set [3 times]
GNU Emacs 24.0.50.1 (x86_64--netbsd) of 2011-06-01 on gco-w12f-177-176.sm.sony.co.jp
Making completion list...

Load-path shadows:
None found.

Features:
(shadow emacsbug gnus-async gnus-dup qp gnus-ml disp-table nndraft nnmh
info tool-bar vc-bzr find-func debug cus-edit cus-start cus-load
help-fns mail-extr sort newcomment multi-isearch mule-util skk help-mode
view utf-7 rfc2104 auth-source eieio byte-opt bytecomp byte-compile
cconv assoc nnimap parse-time utf7 netrc network-stream starttls tls
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
image mouse mm-uu mml2015 pgg pgg-parse pgg-def epg-config mm-view
mml-smime smime password-cache dig mailcap nntp gnus-cache nnir gnus-sum
macroexp nnoo gnus-group gnus-undo nnmail mail-source gnus-start
gnus-spec gnus-int gnus-range message sendmail regexp-opt format-spec
rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader
gnus-win gnus gnus-ems nnheader gnus-util time-date mail-utils mm-util
mail-prsvr wid-edit japan-util ediff-hook vc-hooks lisp-float-type
lisp-mode register page menu-bar rfn-eshadow timer jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18728: 24.0.50; gnus hangs while reading mail from imap server
  2014-10-14 22:56 bug#18728: 24.0.50; gnus hangs while reading mail from imap server tsugutomo.enami
@ 2014-10-15  7:59 ` Andreas Schwab
  2014-10-16 13:22 ` Ted Zlatanov
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2014-10-15  7:59 UTC (permalink / raw)
  To: tsugutomo.enami; +Cc: 18728

tsugutomo.enami@jp.sony.com writes:

> +				      (or (looking-at "\\*")
> +					  (looking-at "[0-9]+ OK NOOP")))))
                                      (looking-at "\\*\\|[0-9]+ OK NOOP")

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18728: 24.0.50; gnus hangs while reading mail from imap server
  2014-10-14 22:56 bug#18728: 24.0.50; gnus hangs while reading mail from imap server tsugutomo.enami
  2014-10-15  7:59 ` Andreas Schwab
@ 2014-10-16 13:22 ` Ted Zlatanov
  2014-10-24  4:24   ` tsugutomo.enami
  1 sibling, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2014-10-16 13:22 UTC (permalink / raw)
  To: tsugutomo.enami; +Cc: 18728

On Wed, 15 Oct 2014 07:56:20 +0900 tsugutomo.enami@jp.sony.com wrote: 

te> The gnus hangs while reading mail from imap server on startup, with
te> displaying "nnimap read NNNNNNk" in mini buffer.  The amount of NNNNNN
te> was about 200Mbytes.
...
te> The work around for me was adding code to ignore above NOOP lines in
te> nnimap-wait-for-response, as follows:

te> --- nnimap.el.orig	2011-06-01 09:27:58.000000000 +0900
te> +++ nnimap.el	2014-10-14 13:56:31.000000000 +0900
te> @@ -1683,7 +1689,8 @@
te>  			(while (and (not (bobp))
te>  				    (progn
te>  				      (forward-line -1)
te> -				      (looking-at "\\*"))))
te> +				      (or (looking-at "\\*")
te> +					  (looking-at "[0-9]+ OK NOOP")))))
te>  			(not (looking-at (format "%d .*\n" sequence)))))
te>  	    (when messagep
te>  	      (nnheader-message 7 "nnimap read %dk" (/ (buffer-size) 1000)))


te> I guess the NOOP lines are response for the NOOP command sent to keep a
te> connection.  The gnus version used here is rather old but, at a glance,
te> the function in upstream repository is almost same.

Could you prepare a patch against Emacs trunk or (preferably) Gnus
master[1], incorporating Andreas' suggestion and with a ChangeLog entry?
I'll apply it to Gnus master and it will make its way to Emacs trunk
shortly thereafter.

Thanks
Ted

[1] http://git.gnus.org/





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18728: 24.0.50; gnus hangs while reading mail from imap server
  2014-10-16 13:22 ` Ted Zlatanov
@ 2014-10-24  4:24   ` tsugutomo.enami
  2014-10-24  6:06     ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: tsugutomo.enami @ 2014-10-24  4:24 UTC (permalink / raw)
  To: 18728

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

Ted Zlatanov <tzz@lifelogs.com> writes:

> Could you prepare a patch against Emacs trunk or (preferably) Gnus
> master[1], incorporating Andreas' suggestion and with a ChangeLog entry?
> I'll apply it to Gnus master and it will make its way to Emacs trunk
> shortly thereafter.

Ok, patch against today's gnus.git is attached.  I've tested by changing
nnimap-keepalive and nnimap-keepalive-timer to send noop command more
frequently.

enami.

[-- Attachment #2: nnimap-wait-for-response fix to ignore NOOP response. --]
[-- Type: text/plain, Size: 851 bytes --]

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 43c5bfc..2156301 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-24  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
+
+	* nnimap.el (nnimap-wait-for-response): Ignore NOOP response requested
+	to keep connection open.
+
 2014-10-20  Glenn Morris  <rgm@gnu.org>
 
 	* Merge in all changes up to 24.4 release.
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index ad48d47..7992151 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1888,7 +1888,7 @@ Return the server's response to the SELECT or EXAMINE command."
 			(while (and (not (bobp))
 				    (progn
 				      (forward-line -1)
-				      (looking-at "\\*"))))
+				      (looking-at "\\*\\|[0-9]+ OK NOOP"))))
 			(not (looking-at (format "%d .*\n" sequence)))))
 	    (when messagep
 	      (nnheader-message-maybe

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#18728: 24.0.50; gnus hangs while reading mail from imap server
  2014-10-24  4:24   ` tsugutomo.enami
@ 2014-10-24  6:06     ` Katsumi Yamaoka
  2014-10-24 13:43       ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2014-10-24  6:06 UTC (permalink / raw)
  To: tsugutomo.enami; +Cc: 18728-done

On Fri, 24 Oct 2014 13:24:18 +0900, tsugutomo enami wrote:
> Ted Zlatanov <tzz@lifelogs.com> writes:

>> Could you prepare a patch against Emacs trunk or (preferably) Gnus
>> master[1], incorporating Andreas' suggestion and with a ChangeLog entry?
>> I'll apply it to Gnus master and it will make its way to Emacs trunk
>> shortly thereafter.

> Ok, patch against today's gnus.git is attached.  I've tested by changing
> nnimap-keepalive and nnimap-keepalive-timer to send noop command more
> frequently.

Thanks for the patch.  I've applied it to the Emacs trunk and
the Gnus git master.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#18728: 24.0.50; gnus hangs while reading mail from imap server
  2014-10-24  6:06     ` Katsumi Yamaoka
@ 2014-10-24 13:43       ` Ted Zlatanov
  0 siblings, 0 replies; 6+ messages in thread
From: Ted Zlatanov @ 2014-10-24 13:43 UTC (permalink / raw)
  To: 18728; +Cc: yamaoka, tsugutomo.enami

On Fri, 24 Oct 2014 15:06:06 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote: 

KY> On Fri, 24 Oct 2014 13:24:18 +0900, tsugutomo enami wrote:

>> Ok, patch against today's gnus.git is attached.  I've tested by changing
>> nnimap-keepalive and nnimap-keepalive-timer to send noop command more
>> frequently.

KY> Thanks for the patch.  I've applied it to the Emacs trunk and
KY> the Gnus git master.

Thank you both!

Ted





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-24 13:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-14 22:56 bug#18728: 24.0.50; gnus hangs while reading mail from imap server tsugutomo.enami
2014-10-15  7:59 ` Andreas Schwab
2014-10-16 13:22 ` Ted Zlatanov
2014-10-24  4:24   ` tsugutomo.enami
2014-10-24  6:06     ` Katsumi Yamaoka
2014-10-24 13:43       ` Ted Zlatanov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).