all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Chasing down a network problem
@ 2012-12-26 21:01 Lars Ingebrigtsen
  2012-12-26 21:02 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2012-12-26 21:01 UTC (permalink / raw)
  To: emacs-devel

Sometimes, while talking to imap.gmail.com, the connection hangs
forever.  `C-g'-ing and popping to the buffer reveals that the process
is invariably dead when this happens.

The loop is basically:

	  (while (memq (process-status process) '(open run))
            ...
	    (accept-process-output process 1))

The connection is a TLS one.

Is it at all possible that a loop like this won't allow Emacs to update
the status of the connection?  So that `process-status' doesn't get the
right response until we hit the idle loop?

It sounds kinda totally unlikely, but I thought I'd ask.

I've added a lot more debugging code now, but it's very difficult to
reproduce the bug.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




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

* Re: Chasing down a network problem
  2012-12-26 21:01 Chasing down a network problem Lars Ingebrigtsen
@ 2012-12-26 21:02 ` Lars Ingebrigtsen
  2012-12-27 17:31   ` Didier Verna
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2012-12-26 21:02 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've added a lot more debugging code now, but it's very difficult to
> reproduce the bug.

D'oh!

There's a condition-case around the loop with this as the quit
condition:

      (quit
       ;; The user hit C-g while we were waiting: kill the process, in case
       ;; it's a gnutls-cli process that's stuck (tends to happen a lot behind
       ;; NAT routers).
       (delete-process process)

Which explains why the process is dead.

Never mind...

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen



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

* Re: Chasing down a network problem
  2012-12-26 21:02 ` Lars Ingebrigtsen
@ 2012-12-27 17:31   ` Didier Verna
  0 siblings, 0 replies; 3+ messages in thread
From: Didier Verna @ 2012-12-27 17:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: emacs-devel

Lars Magne Ingebrigtsen wrote:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> I've added a lot more debugging code now, but it's very difficult to
>> reproduce the bug.
>
> D'oh!
>
> There's a condition-case around the loop with this as the quit
> condition:
>
>       (quit
>        ;; The user hit C-g while we were waiting: kill the process, in case
>        ;; it's a gnutls-cli process that's stuck (tends to happen a lot behind
>        ;; NAT routers).
>        (delete-process process)
>
> Which explains why the process is dead.
>
> Never mind...

  FWIW, I have a lot of problems with mail and news server connections
  that seem to hang up all the time (with both GNU Emacs and XEmacs). To
  the point that I have added this to my gnusrc:

(defcustom dvl-gnus-kill-server-connections t
  "Whether to kill Gnus server connections immediately after use."
  :type 'boolean)

;; This function is hooked into gnus-get-new-news-hook and
;; gnus-summary-exit-hook in order to prevent hangs.
(defun dvl-gnus-kill-server-connections ()
  "Kill Gnus server connections.
See also the variable `dvl-gnus-kill-server-connections'."
  (when dvl-gnus-kill-server-connections
    (call-process "killall" nil nil nil "gnutls-cli")))


This makes things a little better, like, 50%...

-- 
ELS 2013, June 3/4, Madrid, Spain:  http://els2013.european-lisp-symposium.org

Scientific site:   http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com



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

end of thread, other threads:[~2012-12-27 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-26 21:01 Chasing down a network problem Lars Ingebrigtsen
2012-12-26 21:02 ` Lars Ingebrigtsen
2012-12-27 17:31   ` Didier Verna

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.