Gnus development mailing list
 help / color / mirror / Atom feed
* Prevent freezing when having bad connection?
@ 2012-02-10 21:00 Michael Heerdegen
  2012-02-11 15:32 ` Lars Ingebrigtsen
  2012-02-11 19:21 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 12+ messages in thread
From: Michael Heerdegen @ 2012-02-10 21:00 UTC (permalink / raw)
  To: ding

Hi,

I use UMTS at home.  Sometimes, the connection is so bad that I have a
download rate of 0 for several minutes or even hours.

The problem: if I start Gnus in this situation, Emacs gets frozen
forever.  I get nearly 100% CPU usage, but nothing happens anymore.
Even worse, I can't break up.  C-g, ESC ESC ESC, nothing has an effect.
Also closing the UMTS connection makes no difference.

Is there any way to I improve this?


Thanks,

Michael.



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

* Re: Prevent freezing when having bad connection?
  2012-02-10 21:00 Prevent freezing when having bad connection? Michael Heerdegen
@ 2012-02-11 15:32 ` Lars Ingebrigtsen
  2012-02-11 19:21 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-11 15:32 UTC (permalink / raw)
  To: ding; +Cc: michael_heerdegen

Michael Heerdegen <michael_heerdegen@web.de> writes:

> The problem: if I start Gnus in this situation, Emacs gets frozen
> forever.  I get nearly 100% CPU usage, but nothing happens anymore.
> Even worse, I can't break up.  C-g, ESC ESC ESC, nothing has an effect.
> Also closing the UMTS connection makes no difference.
>
> Is there any way to I improve this?

Could you do an "strace -fp" on the Emacs process when this happens?

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome



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

* Re: Prevent freezing when having bad connection?
  2012-02-10 21:00 Prevent freezing when having bad connection? Michael Heerdegen
  2012-02-11 15:32 ` Lars Ingebrigtsen
@ 2012-02-11 19:21 ` Lars Ingebrigtsen
  2012-02-17  3:29   ` Michael Heerdegen
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-11 19:21 UTC (permalink / raw)
  To: ding; +Cc: michael_heerdegen

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I use UMTS at home.  Sometimes, the connection is so bad that I have a
> download rate of 0 for several minutes or even hours.

I've now fixed an infloop in the TLS code in Emacs 24.  Try updating and
see whether the problem has gone away.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome



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

* Re: Prevent freezing when having bad connection?
  2012-02-11 19:21 ` Lars Ingebrigtsen
@ 2012-02-17  3:29   ` Michael Heerdegen
  2012-02-20  7:33     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2012-02-17  3:29 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I've now fixed an infloop in the TLS code in Emacs 24.  Try updating and
> see whether the problem has gone away.

I updated Emacs today, but I still see the problem.

strace -fp just prints

[pid 22477] recv(12, 0xb73cfa0, 5, 0)   = -1 EAGAIN (Resource temporarily unavailable)

over and over.

I'll have no time to look into this for some days (I'll be not at
home).  I'll try to debug this later.


Michael.



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

* Re: Prevent freezing when having bad connection?
  2012-02-17  3:29   ` Michael Heerdegen
@ 2012-02-20  7:33     ` Lars Ingebrigtsen
  2012-02-22  2:07       ` Michael Heerdegen
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Ingebrigtsen @ 2012-02-20  7:33 UTC (permalink / raw)
  To: ding; +Cc: michael_heerdegen

Michael Heerdegen <michael_heerdegen@web.de> writes:

> I updated Emacs today, but I still see the problem.
>
> strace -fp just prints
>
> [pid 22477] recv(12, 0xb73cfa0, 5, 0)   = -1 EAGAIN (Resource temporarily unavailable)

This is a different problem.  The bug I fixed was related to writing,
not reading.

What socket does "12" refer to?  Do something like the following to find
out what it's connected to:

larsi@rusty:~/mgnus$ ls -l /proc/1847/fd/18 
lrwx------ 1 larsi larsi 64 2012-02-20 08:31 /proc/1847/fd/18 -> socket:[40080]
larsi@rusty:~/mgnus$ lsof | grep 40080
emacs     1847      larsi   18u     IPv4              40080      0t0     TCP 10.0.1.3:60200->dough.gmane.org:nntp (ESTABLISHED)

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Rome



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

* Re: Prevent freezing when having bad connection?
  2012-02-20  7:33     ` Lars Ingebrigtsen
@ 2012-02-22  2:07       ` Michael Heerdegen
  2012-02-22 11:21         ` Ted Zlatanov
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2012-02-22  2:07 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

> > strace -fp just prints
> >
> > [pid 22477] recv(12, 0xb73cfa0, 5, 0) = -1 EAGAIN (Resource
> > temporarily unavailable)
>
> This is a different problem.  The bug I fixed was related to writing,
> not reading.

I'll look for the socket when I'm at home again.

BTW, when I got that, I simply pulled out my USB stick, so that the
connection was still active, but with a zera data rate.  I hope that's a
good way to mimic a "bad connection" (or should I better put a metallic
coffee tin around the stick?).


Michael



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

* Re: Prevent freezing when having bad connection?
  2012-02-22  2:07       ` Michael Heerdegen
@ 2012-02-22 11:21         ` Ted Zlatanov
  2012-03-10  1:01           ` Lars Magne Ingebrigtsen
  2012-03-12 22:55           ` Michael Heerdegen
  0 siblings, 2 replies; 12+ messages in thread
From: Ted Zlatanov @ 2012-02-22 11:21 UTC (permalink / raw)
  To: ding

On Wed, 22 Feb 2012 03:07:55 +0100 Michael Heerdegen <michael_heerdegen@web.de> wrote: 

MH> Lars Ingebrigtsen <larsi@gnus.org> writes:
>> > strace -fp just prints
>> >
>> > [pid 22477] recv(12, 0xb73cfa0, 5, 0) = -1 EAGAIN (Resource
>> > temporarily unavailable)
>> 
>> This is a different problem.  The bug I fixed was related to writing,
>> not reading.

MH> I'll look for the socket when I'm at home again.

MH> BTW, when I got that, I simply pulled out my USB stick, so that the
MH> connection was still active, but with a zera data rate.  I hope that's a
MH> good way to mimic a "bad connection" (or should I better put a metallic
MH> coffee tin around the stick?).

I have noticed hung NNTP connections that manifest the same way.
Usually `C-g' will fix it but it's very annoying because it looks as if
it's waiting for the remote server and you sit for 10-15 seconds before
you realize it's hung.  `strace -p' shows read() returning EAGAIN over
and over.  This is hard to simulate though, I have to open the
connection and wait 10 minutes to be sure it will hang.

Lars, I thought we were setting a heartbeat on the TCP connections in
Emacs?  Is Emacs supposed to notice that the NNTP connection is hung?
This is not encrypted with GnuTLS so I think it's an Emacs-level issue.

Ted




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

* Re: Prevent freezing when having bad connection?
  2012-02-22 11:21         ` Ted Zlatanov
@ 2012-03-10  1:01           ` Lars Magne Ingebrigtsen
  2012-03-12 22:57             ` Michael Heerdegen
  2012-03-12 22:55           ` Michael Heerdegen
  1 sibling, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-10  1:01 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> I have noticed hung NNTP connections that manifest the same way.
> Usually `C-g' will fix it but it's very annoying because it looks as if
> it's waiting for the remote server and you sit for 10-15 seconds before
> you realize it's hung.  `strace -p' shows read() returning EAGAIN over
> and over.  This is hard to simulate though, I have to open the
> connection and wait 10 minutes to be sure it will hang.
>
> Lars, I thought we were setting a heartbeat on the TCP connections in
> Emacs?  Is Emacs supposed to notice that the NNTP connection is hung?
> This is not encrypted with GnuTLS so I think it's an Emacs-level issue.

Since `C-g' breaks this reliably, my guess would be that it's not a
TCP/Emacs issue at all, but just a loop in nntp.el that doesn't check
whether the connections is still alive...

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: Prevent freezing when having bad connection?
  2012-02-22 11:21         ` Ted Zlatanov
  2012-03-10  1:01           ` Lars Magne Ingebrigtsen
@ 2012-03-12 22:55           ` Michael Heerdegen
  2012-03-14 14:53             ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2012-03-12 22:55 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> I have noticed hung NNTP connections that manifest the same way.
> Usually `C-g' will fix it but it's very annoying because it looks as
> if it's waiting for the remote server and you sit for 10-15 seconds
> before you realize it's hung.  `strace -p' shows read() returning
> EAGAIN over and over.  This is hard to simulate though, I have to open
> the connection and wait 10 minutes to be sure it will hang.

My feeling is that this is a different issue.  The problem I mean occurs
when starting gnus, and C-g never helps.

But I think I also experienced what you describe some time ago.  I could
successfully avoid this symptom by setting `imap-ping-server' to nil.
Maybe you can try this?


Michael



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

* Re: Prevent freezing when having bad connection?
  2012-03-10  1:01           ` Lars Magne Ingebrigtsen
@ 2012-03-12 22:57             ` Michael Heerdegen
  2012-03-14 14:52               ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Heerdegen @ 2012-03-12 22:57 UTC (permalink / raw)
  To: ding

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> > I have noticed hung NNTP connections that manifest the same way.
> > Usually `C-g' will fix it [...]

> Since `C-g' breaks this reliably, my guess would be that it's not a
> TCP/Emacs issue at all, but just a loop in nntp.el that doesn't check
> whether the connections is still alive...

Please note: for me, C-g doesn't break it, never, even if I wait for
several minutes.

Lars, my last question was: is it ok to mimic a bad connection by
unplugging the USB stick?  Or is this a different case?


Michael



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

* Re: Prevent freezing when having bad connection?
  2012-03-12 22:57             ` Michael Heerdegen
@ 2012-03-14 14:52               ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-14 14:52 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: ding

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Please note: for me, C-g doesn't break it, never, even if I wait for
> several minutes.

Right, so Emacs hangs completely.  So it seems these are two different
bugs.

> Lars, my last question was: is it ok to mimic a bad connection by
> unplugging the USB stick?  Or is this a different case?

It's difficult to say.  Network connection problems are notoriously
difficult to emulate easily.  When you unplug the USB stick, the OS is
usually notified, and can do...  stuff.  Most network problems are,
however, that traffic is just goes missing somewhere, so you have to
fiddle with firewall rules to mimic it.

But if the USB stick removal thing reliably hangs your Emacs for you,
that's a good way to test things.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

* Re: Prevent freezing when having bad connection?
  2012-03-12 22:55           ` Michael Heerdegen
@ 2012-03-14 14:53             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2012-03-14 14:53 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: ding

Michael Heerdegen <michael_heerdegen@web.de> writes:

> But I think I also experienced what you describe some time ago.  I could
> successfully avoid this symptom by setting `imap-ping-server' to nil.
> Maybe you can try this?

`imap-ping-server' isn't used in Emacs 24.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



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

end of thread, other threads:[~2012-03-14 14:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-10 21:00 Prevent freezing when having bad connection? Michael Heerdegen
2012-02-11 15:32 ` Lars Ingebrigtsen
2012-02-11 19:21 ` Lars Ingebrigtsen
2012-02-17  3:29   ` Michael Heerdegen
2012-02-20  7:33     ` Lars Ingebrigtsen
2012-02-22  2:07       ` Michael Heerdegen
2012-02-22 11:21         ` Ted Zlatanov
2012-03-10  1:01           ` Lars Magne Ingebrigtsen
2012-03-12 22:57             ` Michael Heerdegen
2012-03-14 14:52               ` Lars Magne Ingebrigtsen
2012-03-12 22:55           ` Michael Heerdegen
2012-03-14 14:53             ` Lars Magne Ingebrigtsen

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 NNTP newsgroup(s).