Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Cc: Joe Casadonte <jcasadonte@northbound-train.com>,
	ding-list <ding@gnus.org>
Subject: Re: nnimap - not quite there yet?
Date: Fri, 17 Aug 2001 21:33:04 +0200	[thread overview]
Message-ID: <ilubslecz1e.fsf@barbar.josefsson.org> (raw)
In-Reply-To: <vafofpo9a0m.fsf@INBOX.auto.gnus.tok.lucy.cs.uni-dortmund.de> (Kai.Grossjohann@CS.Uni-Dortmund.DE's message of "Thu, 09 Aug 2001 23:52:09 +0200")

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

>> Example: I added an nntp group and set the level to 3.  My
>> gnus-activate-level is set to 1.  When I run gnus-group-get-new-news
>> this new group does not get queried.  That's what I'd like to have
>> happen with my lower-level IMAP folders.
>
> It's what should happen automatically.  If it doesn't happen, I think
> that's a bug in nnimap.

I think it's simply that checking active info is fast for nntp and
slow for nnimap, so noone has noticed this before -- from
`gnus-group-get-new-news':

    (if (and gnus-read-active-file (not arg))
	(progn
	  (gnus-read-active-file)
	  (gnus-get-unread-articles arg))
      (let ((gnus-read-active-file (if arg nil gnus-read-active-file)))
	(gnus-get-unread-articles arg)))
    (gnus-run-hooks 'gnus-after-getting-new-news-hook)

so unless you call `g' with a prefix, it will read the active files.
It seems as if it's only `gnus-get-unread-articles' that check the
active level, but then it's too late (the active file was already
read).

This seems to be consistent with how group levels work for me, `1 g'
etc works, but setting `gnus-activate-level' to 1 does not.

I guess group levels should be used in `gnus-read-active-file*'.  Ok,
patch below.  Please try.

>>>> 4) As has been mentioned elsewhere in recent threads, nnimap (and
>>>>    all of Gnus for that matter) is not terribly fault tolerant.  If
>>>>    a server connection goes down, the connection needs to be
>>>>    severed manually before it can be reconnected.  Again, this is
>>>>    more of a general Gnus issue, I think, but nnimap seems a bit
>>>>    more stubborn then nntp.
>>>
>>> Believe it or not, I never have those problems.  When the connection
>>> goes down for some reason, Gnus brings it back up.  Other than a
>>> slight delay, I don't notice anything.
>>>
>>> Do you use a shell command to access your IMAP servers (ssh, say)?
>>> That might be more problematic.
>>
>> Bingo again.  So, not knowing enough about SSH, this is more an SSH
>> issue then a Gnus/nnimap issue?
>
> Hm.  One idea might be to use ssh port forwarding.  Maybe that helps.
> For example, I run ssh like this:
>
> ssh -f -L 10119:quimby.gnus.org:119 bonny -l grossjoh sleep 3600
>
> This means that `telnet localhost 10119' gives me a connection to
> quimby.gnus.org which goes through bonny.  Ie, the connection from
> localhost to bonny is encrypted via ssh, and the connection from bonny
> to quimby.gnus.org is in the clear, as required by nntp.  This port
> forwarding is alive until the command (sleep 3600) terminates.
>
> Of course, the `sleep 3600' part has a high kludge factor.  Not sure
> what to do about that.  Also, you'd have to arrange for Gnus to start
> this on demand.
>
> There is also an -R option for ssh, which I've never understood.
>
> But I think that Gnus should provide a feature to check whether the
> connection to the remote end has gone down.  The idea is like this:
> Gnus records the time when it sends a command to the remote host.  And
> before sending a command, it looks how much time has elapsed since the
> last command.  If that was more than, say, N seconds, Gnus sends a
> no-op command and looks carefully whether the remote end replies as it
> should.  If the remote end doesn't reply, Gnus takes the connection
> down and tries again.

I've committed an improvement to the network checking, it should
actually work for all native emacs processes now.

I don't think emacs can distinguish between a dead ssh connection or a
live one if it is invoked in a subshell, but ssh port forwards is ok.

--- gnus-start.el.~6.27.~	Fri Aug 17 17:34:19 2001
+++ gnus-start.el	Fri Aug 17 21:18:30 2001
@@ -1821,16 +1821,34 @@
        ((and (eq gnus-read-active-file 'some)
 	     (gnus-check-backend-function 'retrieve-groups (car method))
 	     (not force))
-	(let ((newsrc (cdr gnus-newsrc-alist))
+	(let* ((newsrc (cdr gnus-newsrc-alist))
 	      (gmethod (gnus-server-get-method nil method))
-	      groups info)
+	       groups info
+	       (foreignp (and gmethod
+			     (not (gnus-native-method-p gmethod))
+			     (not (gnus-secondary-method-p method))))
+	       (level (or gnus-activate-level (1+ gnus-level-subscribed)))
+	       (foreign-level
+		(min
+		 (cond ((and gnus-activate-foreign-newsgroups
+			     (not (numberp gnus-activate-foreign-newsgroups)))
+			(1+ gnus-level-subscribed))
+		       ((numberp gnus-activate-foreign-newsgroups)
+			gnus-activate-foreign-newsgroups)
+		       (t 0))
+		 level)))
 	  (while (setq info (pop newsrc))
-	    (when (inline
+	    (when (and
+		   ;; check level on group
+		   (<= (gnus-info-level info) (if foreignp
+						  foreign-level
+						level))
+		   (inline
 		    (gnus-server-equal
 		     (inline
 		       (gnus-find-method-for-group
 			(gnus-info-group info) info))
-		     gmethod))
+		      gmethod)))
 	      (push (gnus-group-real-name (gnus-info-group info))
 		    groups)))
 	  (gnus-read-active-file-2 groups method)))



  parent reply	other threads:[~2001-08-17 19:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-08 20:29 Joe Casadonte
2001-08-08 22:11 ` Kai Großjohann
2001-08-09 19:56   ` Joe Casadonte
2001-08-09 21:52     ` Kai Großjohann
2001-08-09 22:06       ` Paul Jarc
2001-08-09 22:39         ` Kai Großjohann
2001-08-17 19:33       ` Simon Josefsson [this message]
2001-08-08 23:45 ` Amos Gouaux
2001-08-09  6:41 ` Peter Weiss, Sun Microsystems, Germany
2001-08-09 20:23   ` Joe Casadonte
2001-08-09 21:31     ` Joe Casadonte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ilubslecz1e.fsf@barbar.josefsson.org \
    --to=jas@extundo.com \
    --cc=ding@gnus.org \
    --cc=jcasadonte@northbound-train.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).