Gnus development mailing list
 help / color / mirror / Atom feed
* C-g on IMAP and no such article
@ 2010-10-18 15:34 Julien Danjou
  2010-10-18 19:21 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Danjou @ 2010-10-18 15:34 UTC (permalink / raw)
  To: ding

When downloading a big message on IMAP, Emacs starts not responding,
which is normal, we all know.

But when pressing C-g, the message is then marked as deleted like with B
DEL.
And message says:
  No such article (may have expired or been canceled)

This seems very dangerous.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



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

* Re: C-g on IMAP and no such article
  2010-10-18 15:34 C-g on IMAP and no such article Julien Danjou
@ 2010-10-18 19:21 ` Lars Magne Ingebrigtsen
  2010-10-18 19:56   ` Julien Danjou
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-18 19:21 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> When downloading a big message on IMAP, Emacs starts not responding,
> which is normal, we all know.

No, we don't.  :-)

> But when pressing C-g, the message is then marked as deleted like with B
> DEL.
> And message says:
>   No such article (may have expired or been canceled)
>
> This seems very dangerous.

This sounds difficult to reproduce.  Could you `debug-on-quit' this and
find out what's happening and how to avoid this?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: C-g on IMAP and no such article
  2010-10-18 19:21 ` Lars Magne Ingebrigtsen
@ 2010-10-18 19:56   ` Julien Danjou
  2010-10-18 19:58     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Danjou @ 2010-10-18 19:56 UTC (permalink / raw)
  To: ding

On Mon, Oct 18 2010, Lars Magne Ingebrigtsen wrote:

> This sounds difficult to reproduce.  Could you `debug-on-quit' this and
> find out what's happening and how to avoid this?

I tried, but I do not get anything on C-g, for a reason I do not know,
so I can't get any backtrace. :-(

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



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

* Re: C-g on IMAP and no such article
  2010-10-18 19:56   ` Julien Danjou
@ 2010-10-18 19:58     ` Lars Magne Ingebrigtsen
  2010-10-18 20:05       ` Julien Danjou
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-18 19:58 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> I tried, but I do not get anything on C-g, for a reason I do not know,
> so I can't get any backtrace. :-(

Must be something inhibiting `C-g' somewhere in the path?  

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: C-g on IMAP and no such article
  2010-10-18 19:58     ` Lars Magne Ingebrigtsen
@ 2010-10-18 20:05       ` Julien Danjou
  2010-10-18 20:11         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Danjou @ 2010-10-18 20:05 UTC (permalink / raw)
  To: ding

On Mon, Oct 18 2010, Lars Magne Ingebrigtsen wrote:

> Must be something inhibiting `C-g' somewhere in the path?  

What could it be then? I mean, I got a backtrace on every other C-g.
Is that because Emacs is doing something in the background? The C-g is
sent to the imap process which is ignoring it?

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



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

* Re: C-g on IMAP and no such article
  2010-10-18 20:05       ` Julien Danjou
@ 2010-10-18 20:11         ` Lars Magne Ingebrigtsen
  2010-10-20 10:32           ` Julien Danjou
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-18 20:11 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> What could it be then? I mean, I got a backtrace on every other C-g.
> Is that because Emacs is doing something in the background? The C-g is
> sent to the imap process which is ignoring it?

There's two ways: Binding `inhibit-quit', and using a `condition-case'
that ignores `quit'.  So doing a `debug-on-entry' on, say,
`nnimap-request-article', and you'll see the call tree, and then you can
inspect the tree for those forms...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: C-g on IMAP and no such article
  2010-10-18 20:11         ` Lars Magne Ingebrigtsen
@ 2010-10-20 10:32           ` Julien Danjou
  2010-10-21  1:26             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Danjou @ 2010-10-20 10:32 UTC (permalink / raw)
  To: ding

On Mon, Oct 18 2010, Lars Magne Ingebrigtsen wrote:

> There's two ways: Binding `inhibit-quit', and using a `condition-case'
> that ignores `quit'.  So doing a `debug-on-entry' on, say,
> `nnimap-request-article', and you'll see the call tree, and then you can
> inspect the tree for those forms...

Well, anyhow I've found part of the problem.
First, I've set nnimap-fetch-partial-articles and there was a bug I
fixed in commit eb6b2e4e9bff924ab4f864323acf973b25643460.

Then, there seems to be some… race condition. I can bypass the bug in
the debugger, but not without it. When it raises that:

Debugger entered--entering a function:
* nnimap-get-response(1762)
  nnimap-command("UID FETCH %d (%s %s)" 26382 "BODY.PEEK[HEADER]" "BODY.PEEK[1]")
  nnimap-get-partial-article(26382 ("1") (("text" "plain" ("charset"
  "us-ascii") nil nil "7bit" 2 1 nil "1" nil nil) [...] )
  ...

It *seems* that if I wait for the *nnimap* buffer to show the OK
response line, the code works fine. However, if I don't, therefore if
I'm not in the debugger, it hangs for ever. Note that the
nnimap-wait-response loop seems OK since I hitted search-backward a
couple of times with it returning nil, and then returning an integer and
I was available to execute the whole things without a problem.

So far I'm stuck.


Another thing I noticed while I'm at it. The message I used to test was
compose of a text/plain and a message/rfc822. I had
nnimap-fetch-partial-articles set to "text/", and all I got was an empty
message, since the sender did not write anything. But I did not had any
MIME part buttons, so it was hard to know there was another mime part
which was a message/ one. I've added message/ to the
nnimap-fetch-partial-articles regexp so I can see it.

Maybe there is some code thinking it's useless to show button for such a
mime part since we used to always show them inline? I don't know.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



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

* Re: C-g on IMAP and no such article
  2010-10-20 10:32           ` Julien Danjou
@ 2010-10-21  1:26             ` Lars Magne Ingebrigtsen
  2010-10-21  9:17               ` Julien Danjou
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-21  1:26 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> Well, anyhow I've found part of the problem.
> First, I've set nnimap-fetch-partial-articles and there was a bug I
> fixed in commit eb6b2e4e9bff924ab4f864323acf973b25643460.
>
> Then, there seems to be some… race condition. I can bypass the bug in
> the debugger, but not without it. When it raises that:
>
> Debugger entered--entering a function:
> * nnimap-get-response(1762)
>   nnimap-command("UID FETCH %d (%s %s)" 26382 "BODY.PEEK[HEADER]" "BODY.PEEK[1]")

So if you have nnimap-fetch-partial-articles set, then Gnus hangs
sometimes?  Or do the articles it hangs on have anything in common?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: C-g on IMAP and no such article
  2010-10-21  1:26             ` Lars Magne Ingebrigtsen
@ 2010-10-21  9:17               ` Julien Danjou
  2010-10-21 16:00                 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Danjou @ 2010-10-21  9:17 UTC (permalink / raw)
  To: ding

On Thu, Oct 21 2010, Lars Magne Ingebrigtsen wrote:

> So if you have nnimap-fetch-partial-articles set, then Gnus hangs
> sometimes?  Or do the articles it hangs on have anything in common?

Now I fixed the bugs :-) it does not hang. It just print a waiting
cursor for 15s, while the message is downloaded without any progress
message (which is disturbing).

If I press C-g while it is downloading:

[...]
Du5QiqO5mxuHPHSp4vMJPK/nTuFi7vgZT+7/ABpg+z7wu0c+hqqwmc7d3HtUn2c7RkfiDTuFi6DH
E+DDux70rXreZmOLaR70xURkG8ZPuaXZBE/DYJ/GhCaHnVL8lW3/AHTkCtiPxV51p5N
Process *nnimap* killed

It kills the process. And then mark the message with a big G, so it's
dangerous. I think it's because request-article returns nil so it thinks
the message has disappeared.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



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

* Re: C-g on IMAP and no such article
  2010-10-21  9:17               ` Julien Danjou
@ 2010-10-21 16:00                 ` Lars Magne Ingebrigtsen
  2010-10-21 16:21                   ` Julien Danjou
  0 siblings, 1 reply; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-21 16:00 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> If I press C-g while it is downloading:
>
> [...]
> Du5QiqO5mxuHPHSp4vMJPK/nTuFi7vgZT+7/ABpg+z7wu0c+hqqwmc7d3HtUn2c7RkfiDTuFi6DH
> E+DDux70rXreZmOLaR70xURkG8ZPuaXZBE/DYJ/GhCaHnVL8lW3/AHTkCtiPxV51p5N
> Process *nnimap* killed
>
> It kills the process. And then mark the message with a big G, so it's
> dangerous. I think it's because request-article returns nil so it thinks
> the message has disappeared.

`C-g' should break and return an error, I think.  (To avoid having
-request-article return anything.)  Why isn't it doing so?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

* Re: C-g on IMAP and no such article
  2010-10-21 16:00                 ` Lars Magne Ingebrigtsen
@ 2010-10-21 16:21                   ` Julien Danjou
  2010-10-21 16:25                     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 12+ messages in thread
From: Julien Danjou @ 2010-10-21 16:21 UTC (permalink / raw)
  To: ding

On Thu, Oct 21 2010, Lars Magne Ingebrigtsen wrote:

> `C-g' should break and return an error, I think.  (To avoid having
> -request-article return anything.)  Why isn't it doing so?

Unfortunately, I don't know. I can't find why C-g kill the process and
does not honor debug-on-quit. That would help me understanding.

Debugging nnimap-request-article just shows it is running
nnimap-wait-for-response, which run accept-process-output each time it
does not find the answer. That's probably in that loop I press C-g.

Is there a chance that sending quit signal is killing a process if Emacs
is running accept-process-output?

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info



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

* Re: C-g on IMAP and no such article
  2010-10-21 16:21                   ` Julien Danjou
@ 2010-10-21 16:25                     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 12+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-10-21 16:25 UTC (permalink / raw)
  To: ding

Julien Danjou <julien@danjou.info> writes:

> Debugging nnimap-request-article just shows it is running
> nnimap-wait-for-response, which run accept-process-output each time it
> does not find the answer. That's probably in that loop I press C-g.
>
> Is there a chance that sending quit signal is killing a process if Emacs
> is running accept-process-output?

But killing the process shouldn't inhibit the `C-g' from returning to
the top-level, anyway.  (The point is to not have -request-article
return anything...)

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




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

end of thread, other threads:[~2010-10-21 16:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-18 15:34 C-g on IMAP and no such article Julien Danjou
2010-10-18 19:21 ` Lars Magne Ingebrigtsen
2010-10-18 19:56   ` Julien Danjou
2010-10-18 19:58     ` Lars Magne Ingebrigtsen
2010-10-18 20:05       ` Julien Danjou
2010-10-18 20:11         ` Lars Magne Ingebrigtsen
2010-10-20 10:32           ` Julien Danjou
2010-10-21  1:26             ` Lars Magne Ingebrigtsen
2010-10-21  9:17               ` Julien Danjou
2010-10-21 16:00                 ` Lars Magne Ingebrigtsen
2010-10-21 16:21                   ` Julien Danjou
2010-10-21 16:25                     ` 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).