Thread View: news.software.nntp
6 messages
6 total messages
Started by Steve Crook
Wed, 12 Sep 2012 16:09
437 Duplicate on quit
Author: Steve Crook
Date: Wed, 12 Sep 2012 16:09
Date: Wed, 12 Sep 2012 16:09
29 lines
1976 bytes
1976 bytes
Hi all,
I've got a Python program that uses the nntplib library. It's been
running as a Daemon for months (if not years). Recently it logged a
traceback:-
Traceback (most recent call last):
File "/usr/local/bin/nymserv", line 53, in run
pool.process()
File "/usr/local/bin/nymserv", line 120, in process
self.post_files(peers, pool_files)
File "/usr/local/bin/nymserv", line 206, in post_files
peers[host].quit()
File "/usr/lib/python2.6/nntplib.py", line 599, in quit
resp = self.shortcmd('QUIT')
File "/usr/lib/python2.6/nntplib.py", line 259, in shortcmd
return self.getresp()
File "/usr/lib/python2.6/nntplib.py", line 218, in getresp
raise NNTPTemporaryError(resp)
NNTPTemporaryError: 437 Duplicate
The server sending the 437 Duplicate error is my own INN server. It's
very easy to handle this in my code but I'm surprised to see that
response to a "quit" command.
--
What shall we use
To fill the empty spaces
Where we used to talk?
Re: 437 Duplicate on quit
Author: Julien ÉLIE
Date: Wed, 12 Sep 2012 20:19
Date: Wed, 12 Sep 2012 20:19
24 lines
2370 bytes
2370 bytes
Hi Steve, > I've got a Python program that uses the nntplib library. It's been > running as a Daemon for months (if not years). Recently it logged a > traceback:- > > NNTPTemporaryError: 437 Duplicate > > The server sending the 437 Duplicate error is my own INN server. It's > very easy to handle this in my code but I'm surprised to see that > response to a "quit" command. Is the answer from innd or nnrpd with IHAVE? Both of them can send it. Can commands be pipelined in your Python program? It could explain the answer because the answer to the QUIT command is appended to the buffer waiting to be sent to the client. I do not otherwise understand how a 437 response code could have been sent in response to a QUIT command. (It could of course be a bug in INN but probably not easy to find out as I imagine it is not reproducible?) -- Julien ÉLIE « Tout est dans tout, et réciproquement. » (Pierre Dac)
Re: 437 Duplicate on quit
Author: Russ Allbery
Date: Wed, 12 Sep 2012 20:32
Date: Wed, 12 Sep 2012 20:32
21 lines
2311 bytes
2311 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> Is the answer from innd or nnrpd with IHAVE? Both of them can send it.
> Can commands be pipelined in your Python program? It could explain the
> answer because the answer to the QUIT command is appended to the buffer
> waiting to be sent to the client. I do not otherwise understand how a
> 437 response code could have been sent in response to a QUIT
> command. (It could of course be a bug in INN but probably not easy to
> find out as I imagine it is not reproducible?)
Yeah, I'm guessing buffer desynchronization too. My guess is that the 437
was (from the INN perspective) in response to some earlier command, but
the Python script didn't agree with INN about how many commands it had
outstanding and needed to read status from before getting the response to
QUIT.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: 437 Duplicate on quit
Author: Steve Crook
Date: Thu, 13 Sep 2012 10:30
Date: Thu, 13 Sep 2012 10:30
25 lines
2105 bytes
2105 bytes
On Wed, 12 Sep 2012 22:19:51 +0200, Julien ÉLIE wrote in Message-Id: <k2qqp7$9d1$1@news.trigofacile.com>: Hi Julien, > Is the answer from innd or nnrpd with IHAVE? Both of them can send it. My program only uses IHAVE. > Can commands be pipelined in your Python program? It could explain the > answer because the answer to the QUIT command is appended to the buffer > waiting to be sent to the client. I do not otherwise understand how a > 437 response code could have been sent in response to a QUIT command. This sounds a likely explanation. The program can potentially inject a lot of articles in bursts. It also attempts to inject them to multiple peers so a lot of 437 Duplicate messages are to be expected. > (It could of course be a bug in INN but probably not easy to find out as > I imagine it is not reproducible?) Sadly, no. It may be a very long time before I see it again. Perhaps never. :) -- What shall we use To fill the empty spaces Where we used to talk?
Re: 437 Duplicate on quit
Author: Julien ÉLIE
Date: Fri, 14 Sep 2012 19:20
Date: Fri, 14 Sep 2012 19:20
20 lines
2037 bytes
2037 bytes
Hi Steve, >> Is the answer from innd or nnrpd with IHAVE? Both of them can send it. > My program only uses IHAVE. Using innd or nnrpd? (IHAVE commands can be answered by nnrpd if configured in readers.conf.) > The program can potentially inject a > lot of articles in bursts. It also attempts to inject them to multiple > peers so a lot of 437 Duplicate messages are to be expected. Does the program count the number of answers received, and when it does not expect any other answer, it sends a QUIT command? -- Julien ÉLIE « Tout est dans tout, et réciproquement. » (Pierre Dac)
Re: 437 Duplicate on quit
Author: Steve Crook
Date: Sat, 15 Sep 2012 10:11
Date: Sat, 15 Sep 2012 10:11
33 lines
2458 bytes
2458 bytes
On Fri, 14 Sep 2012 21:20:24 +0200, Julien ÉLIE wrote in Message-Id: <k3001o$r9h$1@news.trigofacile.com>: >>> Is the answer from innd or nnrpd with IHAVE? Both of them can send it. >> My program only uses IHAVE. > > Using innd or nnrpd? (IHAVE commands can be answered by nnrpd if > configured in readers.conf.) These are being handled by innd. >> The program can potentially inject a >> lot of articles in bursts. It also attempts to inject them to multiple >> peers so a lot of 437 Duplicate messages are to be expected. > > Does the program count the number of answers received, and when it does > not expect any other answer, it sends a QUIT command? No, it handles each IHAVE in a sequential manner and expects a response to each before progressing to the next. If the response is a 4xx, the nntplib raises an NNTPTemporaryError. If it's a 5xx, NNTPPermanentError is raised. If no error is raised, the injection is assumed successful. The traceback happened because I wasn't trapping NNTPTemporaryError when closing the connections with QUIT. My code can be viewed here: https://github.com/crooks/nymserv/blob/master/nymserv/nymserv The nntp element begins at line 63. -- What shall we use To fill the empty spaces Where we used to talk?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads