Thread View: news.software.readers
8 messages
8 total messages
Started by Nick Knight
Fri, 12 May 2000 00:00
Problems with LIST ACTIVE Closing Connection
Author: Nick Knight
Date: Fri, 12 May 2000 00:00
Date: Fri, 12 May 2000 00:00
63 lines
3949 bytes
3949 bytes
Hi. I've had a nagging, sporadic problem with my code that collects the list of active news groups. I'll try to describe it briefly, but some detail is required. I'm looking for better/different ways to acquire a COMPLETE list of available newsgroups. On newsservers with LARGE lists, there seems to be (sometimes?) a tendency for the newsserver to close the connection, without any code/message either before any of the list is sent, or shortly after it starts. I am experiencing this myself (but am more worried about other-user reports). When at work, over a full T1 connection and fast local network, LIST ACTIVE returns a complete list dependably, over and over again. Using dial-up (with work as the provider), I get disconnected after receiving a very small portion of the list. However, on occassion, the list will come across fine! I have tried various mutations of this logic. My current code walks through the alphabet and gets LIST ACTIVE for a*, b*, etc., making provisions for non-alphabetic starts. This has improved things with the slow connection, except the a* list disconnects. Easy to see that this contains the largest number of groups (all the alt.*'s plus many more). So I broke it down to walk through the a*'s in steps. It collects the alt.* heirarcy alphabetically (alt.a*, alt.b*, etc). Wouldn't you know, it disconnects repeatedly getting alt.c*. I have added a retry looped, and it on some troublesome patters it will eventually succeed, but after 25 retries, "alt.c*" just fails. I'm behind a firewall, and I'm not sure if I'm seeing the actual server banner or a filtered copy, but it doesn't identify itself to me via telnet. All I get is "200 NNTP Server ready (posting ok)" [Using another machine, I see I'm accessing something called Typhoon v1.2.2, and yes, through a proxy :)] NOTE that I'm not really reporting a unique problem with my server, but I've got enough user reports of this happening that I know it's not uncommon. Users often report that "other products" get the list fine. Then I've had reports that my program and another fails, but Netscape fetches a complete list fine. So, I'm guessing there's a better way to do this, or perhaps a different way. Can anyone explain what the problem really is? Is it the size of the resulting list? Is it somehow dependent on connection speed (it seems to be, but I can't imagine how)? Why would a newsserver (predictably) disconnect in the middle of transmitting data, without any message or code? (It will disconnect quickly when I telnet in and type "LIST ACTIVE"). Is this one particular newsserver with a known problem? Is it an issues with server load and time-of-day (I have a better success rate testing in early morning US-time than in the evening)? It seems 85-90% of my users see none of this. But 10-15% with problems, including myself, is too large a number to claim "odd circumstances". Thanks in advance, Nick -- ----------------------------------------------------------- Nick Knight <nick@secant.com> http://nick.secant.com Senior Software Engineer Secant Technologies, Inc. http://www.secant.com -----------------------------------------------------------
Re: Problems with LIST ACTIVE Closing Connection
Author: J. B. Moreno
Date: Fri, 12 May 2000 00:00
Date: Fri, 12 May 2000 00:00
42 lines
2905 bytes
2905 bytes
Nick Knight <nick@secant.com> wrote: > I'm behind a firewall, and I'm not sure if I'm seeing the actual server > banner or a filtered copy, but it doesn't identify itself to me via > telnet. All I get is "200 NNTP Server ready (posting ok)" [Using another > machine, I see I'm accessing something called Typhoon v1.2.2, and yes, > through a proxy :)] NOTE that I'm not really reporting a unique problem > with my server, but I've got enough user reports of this happening that I > know it's not uncommon. Users often report that "other products" get the > list fine. Then I've had reports that my program and another fails, but > Netscape fetches a complete list fine. Hmn, I don't know if there is any connection or not, but I just saw this in the PAN changelog: > 2000-04-26 Charles Kerr <charles@skywalker.ou.edu> > > (Tweak for Typhoon 1.2.3) > > * pan/task-grouplist.c (nntp_grouplist_download_new): Alex V Flinsch > <avflinsch@att.net> reports that asking for new groups since > 19700101 000000 GMT doesn't work on Typhoon v1.2.3, but that > 19700101 000001 does. So the initial string has been set to this. > I've confirmed this on a Typhoon server I use. I wonder if there might be any connection? Alternatively, are you batching the commands or are you simply doing the various LIST ACTIVE commands in sequence -- if the latter you might try doing the former (this sounds like a problem with the server taking too long to prepare the results and the connection timing out before it is ready to spit out it's answer, if you have it working on something else the timing ought to be different). Hmn, if this is actually the case, then you could "avoid" the problem by sending a series of "stat" or "group" commands in order to keep the connection active without unduly messing things up otherwise. -- John B. Moreno
Re: Problems with LIST ACTIVE Closing Connection
Author: Nick Knight
Date: Fri, 12 May 2000 00:00
Date: Fri, 12 May 2000 00:00
40 lines
2575 bytes
2575 bytes
In <1eaiydr.1ouc4bz9wlgbdN%planb@newsreaders.com>, on 05/12/2000 at 03:24 PM, planb@newsreaders.com (J. B. Moreno) said: >Alternatively, are you batching the commands or are you simply doing the >various LIST ACTIVE commands in sequence -- if the latter you might try >doing the former (this sounds like a problem with the server taking too >long to prepare the results and the connection timing out before it is >ready to spit out it's answer, if you have it working on something else >the timing ought to be different). Thanks for the response. I don't think it's a connection timeout issue. I mean, the "a*" list fails within 60 seconds, and this after sending some results. Sometimes. So, the server often sends a few blocks of data (my recv() call is executed a couple of times) and then suddenly errors because the socket is closed. I'm supplying a large buffer and I've never seen it get very full ... not that I can recall. However, I've suspected as you suggest ... that it's something on the server side shutting down when it seems too large of a list requested. But then, why not on my T1 connection here? It is a synchronized process. I send a "LIST ACTIVE a*" and then read from the socket until I get the right "." marker. If it fails, I resend the same command (limited by count). If it succeeds, it goes for "b*". I have the weekend to play on my "slow" dial-up connection. I'll experiment more and watch for more posts, if any. Thanks again! Nick -- ----------------------------------------------------------- Nick Knight <nick@secant.com> http://nick.secant.com Senior Software Engineer Secant Technologies, Inc. http://www.secant.com -----------------------------------------------------------
Re: Problems with LIST ACTIVE Closing Connection
Author: Nick Knight
Date: Fri, 12 May 2000 00:00
Date: Fri, 12 May 2000 00:00
71 lines
4359 bytes
4359 bytes
In <20000512204628.625$Tz@newsreader.com>, on 05/13/2000 at 12:46 AM, curt@kcwc.com (Curt Welch) said: >Is this a dial-up server provided from your work instead of from a "real" >ISP? I suspect it's set up wrong. Whoever configured your dial-in >modems probably did it wrong. After reading your very thorough account of what is probably happening, it just makes too much sense. I think the problem is some configuration of the dailup support software/hardware. There are a few minor issues that don't fit perfectly with this explanation, but most of it does. I actually use 4 different lines, all display this problem equally, but they are all similarly equipped on the answering side. I did change the size of my recv() buffer from 32000 to 512. No difference, but it was worth a shot. >I'm assuming it's the dial-in side and not >your modem since you said other people were having the same problem. >(Are they all using the same number to dial into?) Well, when I said "other people", I meant users of the software I author OUTSIDE of my company. I do have reports of this type of issue in enough cases to make it an issue, but the majority of installs "just work". I had already come up with an algorithm that I liked and had finished coding it just as your post came in. It was really pretty simple to work around the issue. And although you say I shouldn't have to, unless I can pinpoint the issue exactly and solve it for everyone, this algorithm will keep breaking the problem down until it goes away. I've run through it several times here (I'm on my troublesome dialup now) and it's succeeded (overall, using this algorithm) several times. Simple really. I do get "parts" almost aphabetically, <a*, a*, b*, etc make a special case for ".". If I cannot collect a list after 5 tries, I recurse into the same routine passing the existing pattern, and the alphabet-split is appended to this prefix. So, for example, when a* fails 5 times (and it always does here for me), I recurse passing "a" as the prefix. The code then progresses through aa*, ab*, etc.,. It gets fairly deep into aol.?*, go figure, before it recovers and pops back out. Again, I am able to acquire the entire list this way, dependably, from this connection. And, for the other users that share this problem, I trust this will do better for them too. I like breaking it up a little for dialups, anyway, simply because there's better recovery and the need to retry smaller chunks if something does go wrong. Back to the idea of a bad modem/interface setup. You had mentioned probably seeing this when ftp'ing (or downloading via http). However, I do transfer large files via both of these methods all of the time. Never a problem. File much larger than my resulting groups list. And, my pop3/smtp connections seem to handle all the Very Large attachments I test. I do still agree it's a transport issue with my dialup ... despite the fact that the problem effects (or seems to) only getting the groups list. Although I have "worked around" this problem in a way I like, I will still explore your ideas further. I would like to know, for certain, what the problem is. Again, I appreciate your detailed thoughts. Thanks much. Nick -- ----------------------------------------------------------- Nick Knight <nick@secant.com> http://nick.secant.com Senior Software Engineer Secant Technologies, Inc. http://www.secant.com -----------------------------------------------------------
Re: Problems with LIST ACTIVE Closing Connection
Author: Curt Welch
Date: Sat, 13 May 2000 00:00
Date: Sat, 13 May 2000 00:00
98 lines
5944 bytes
5944 bytes
Nick Knight <nick@secant.com> wrote: > Hi. > > I've had a nagging, sporadic problem with my code that collects the list > of active news groups. I'll try to describe it briefly, but some detail > is required. I'm looking for better/different ways to acquire a COMPLETE > list of available newsgroups. > > On newsservers with LARGE lists, there seems to be (sometimes?) a > tendency for the newsserver to close the connection, without any > code/message either before any of the list is sent, or shortly after it > starts. No, it's not the news server that decides to close that connecion. That will never happen unless it's set to time out and you stop reading for the time-out period (which is normally 5 minutes or more). > I am experiencing this myself (but am more worried about other-user > reports). When at work, over a full T1 connection and fast local > network, LIST ACTIVE returns a complete list dependably, over and over > again. Using dial-up (with work as the provider), I get disconnected > after receiving a very small portion of the list. However, on occassion, > the list will come across fine! > > I have tried various mutations of this logic. My current code walks > through the alphabet and gets LIST ACTIVE for a*, b*, etc., making > provisions for non-alphabetic starts. Ugh. Stop it. Stop it now. LIST ACTIVE will _NEVER_ fail like that. You never ever need to to play games like that to reduce the size of the output from the NNTP server. Your problem has nothing to do with NNTP or the NNTP server or your application. Your problem is your internet connection. Stop hacking your application and fix your dial-up connection. Is this a dial-up server provided from your work instead of from a "real" ISP? I suspect it's set up wrong. Whoever configured your dial-in modems probably did it wrong. I'm assuming it's the dial-in side and not your modem since you said other people were having the same problem. (Are they all using the same number to dial into?) Plus, the problem as you describe it I think would only happen if the modems on the upstream side of the data flow were the ones set up wrong. It sounds to me like a flow control problem. i.e, you don't have flow control set up, or it's set up incorrectly. What happens is this. When you send the LIST ACTIVE command, and the server starts sending the response. TCP/IP has flow control - but the amount of data it will send before stoping is limited by the window size of the connection - and that can be very large - 65K for example. So the server will end up trying to send that much data to the modem before it stops. The connection between the terminal server and them modem may well be at a very high rate - say 115k or whatever. But the modem connection speed will vary depending on the connection and the speed of the user modem etc. If the modem is running at 28K over the phone line, and the serial connection between the terminal server and the dial-in modem is higher, then the modem has to be able to tell the terminal server to stop sending data. That's what flow control is for. If it can't, the terminal server will just dump all the data (the 65K TCP/IP window full of data) to the modem. But because the modem can't hold all that, it just throws it away. All expect they first small chunk which makes it to you ok. TCP will try to ack the data you got, but depending on what's happening, it may not get though correctly - or for example, if the modem is sending ^S ^Q as flow control when the terminal server isn't expecting it, that could be corrupting your ack packets going back. So after a short period, the TCP code closes the connection because it's unable to talk correctly to your other end. All this only happens when the fast side (the server), needs to dump a lot of data. For small files, this problem will never been seen. That's why the dial-in modems can "seem" to work correctly when in fact that are all fucked up. You can probaly produce the same errors just by trying to ftp a large file from the server down to your client for exmaple. The TCP window size might be affected by the size of the read buffer you are using in your application. Making the buffer smaller might actually fix the problem (like 500 bytes or 1K). If the TCP window size is smaller than the buffer in your modem, then the problem won't bite you because the server will never be trying to send more data than the modem can hold (without flow control). But if that does fix it, it just proves you have a flow control problem because the modems aren't configured correctly. The problem could be caused by how your modem is set up instead - but then that doesn't explain why others would see the same error. And the symptoms you report seem to better fit a problem with the other end. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Problems with LIST ACTIVE Closing Connection
Author: Curt Welch
Date: Sat, 13 May 2000 00:00
Date: Sat, 13 May 2000 00:00
50 lines
3162 bytes
3162 bytes
Nick Knight <nick@secant.com> wrote: > In <20000512204628.625$Tz@newsreader.com>, on 05/13/2000 > at 12:46 AM, curt@kcwc.com (Curt Welch) said: > > >Is this a dial-up server provided from your work instead of from a > >"real" ISP? I suspect it's set up wrong. Whoever configured your > >dial-in modems probably did it wrong. > > After reading your very thorough account of what is probably happening, > it just makes too much sense. I think the problem is some configuration > of the dailup support software/hardware. There are a few minor issues > that don't fit perfectly with this explanation, but most of it does. I > actually use 4 different lines, all display this problem equally, but > they are all similarly equipped on the answering side. > > I did change the size of my recv() buffer from 32000 to 512. No > difference, but it was worth a shot. > > >I'm assuming it's the dial-in side and not > >your modem since you said other people were having the same problem. > >(Are they all using the same number to dial into?) > > Well, when I said "other people", I meant users of the software I author > OUTSIDE of my company. I do have reports of this type of issue in enough > cases to make it an issue, but the majority of installs "just work". Strange. > I had already come up with an algorithm that I liked and had finished > coding it just as your post came in. It was really pretty simple to work > around the issue. Does your application ever try to read a large article? You should see the same problem there and in that case there is no way to work around it because there are no options in NNTP for reading only part of the body. If you read large articles, and don't see the problem, then you have a very strange bug in your code which reads the LIST ACTIVE data. To the news server and to TCP/IP, there is no difference between LIST ACTIVE and ARTICLE 12345. In any case, you should never have to play those types of games with breaking up the LIST ACTIVE output. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Problems with LIST ACTIVE Closing Connection
Author: Nick Knight
Date: Sat, 13 May 2000 00:00
Date: Sat, 13 May 2000 00:00
52 lines
3232 bytes
3232 bytes
In <20000513082418.620$fL@newsreader.com>, on 05/13/2000
at 12:24 PM, curt@kcwc.com (Curt Welch) said:
>Does your application ever try to read a large article? You should see
>the same problem there and in that case there is no way to work around it
>because there are no options in NNTP for reading only part of the body.
I have never seen a problem with fetching a large article, nor ever had
one reported. However, I probably should test this via a couple of binary
newsgroups, eh?
>If you read large articles, and don't see the problem, then you have a
>very strange bug in your code which reads the LIST ACTIVE data. To the
>news server and to TCP/IP, there is no difference between LIST ACTIVE and
>ARTICLE 12345.
See, your notion that it was in dialup settings appealed to me. I mean, I
wanted to believe it was in my code; that's why I was asking. However, I
described in my original post that I could telnet to the newsserver, type
"LIST ACTIVE" and within a short amount of time, would lose the
connection.
I do, sometimes, now that I checked, get short, unterminated XOVER
responses. Same thing. This was easy to code around and I did this some
time ago. I'll have to revisit this (via telnet) and make sure it's the
same exact thing, but I'll bet it is.
I'll do more playing, but I'll also investigate settings at the
dialup-answer end, and ask more questions about our firewall/gateway. I'm
reluctant to call THAT the problem, as it's the same transport path
whether I'm at work (fast, always works) or home (dialup through a work
machine). Perhaps it's some odd buffer size combination/conflict. Since
it isn't unqiue to my settup, I'll have to continue to explore coded
solutions ("work arounds") too.
I mean, what kinds of bugs can I have with a simple call to recv() in a
loop? I guess I can study the code around it, but there isn't much! I'll
take a look, and perhaps I'll code up a very simple program test problem
without ANY overhead, that just collects the results of a LIST ACTIVE.
Thanks again.
Nick
--
-----------------------------------------------------------
Nick Knight <nick@secant.com> http://nick.secant.com
Senior Software Engineer
Secant Technologies, Inc. http://www.secant.com
-----------------------------------------------------------
Re: Problems with LIST ACTIVE Closing Connection
Author: Curt Welch
Date: Sat, 13 May 2000 00:00
Date: Sat, 13 May 2000 00:00
90 lines
5184 bytes
5184 bytes
Nick Knight <nick@secant.com> wrote:
> In <20000513082418.620$fL@newsreader.com>, on 05/13/2000
> at 12:24 PM, curt@kcwc.com (Curt Welch) said:
>
> >Does your application ever try to read a large article? You should see
> >the same problem there and in that case there is no way to work around
> >it because there are no options in NNTP for reading only part of the
> >body.
>
> I have never seen a problem with fetching a large article, nor ever had
> one reported. However, I probably should test this via a couple of
> binary newsgroups, eh?
Yes, I'd suggest you do that.
Here's a list of Message-IDs for recent articles > 800K in size:
<sukqhs4gvhad227ok7ffp7i0gkvsd6ag6r@4ax.com>
<2vkqhss8lrd35dgsoco4bmi132c15g2ra1@4ax.com>
<5vkqhss0ppr77t323i3eg10ejrq4ls21h0@4ax.com>
<n7mqhsoirs1gaqag85dqa1nmpqbqpcb9fa@4ax.com>
<jV8C56Nv$GA.258@news1.sys.netsgo.com>
<gK9tL4Nv$GA.221@news1.sys.netsgo.com>
<10zAo7Nv$GA.239@news1.sys.netsgo.com>
<v7mqhsoftd075f2038rg7eodc0s3c4f23l@4ax.com>
<02#9R7Nv$GA.76@news1.sys.netsgo.com>
<h5mqhs42589vcq4ac4l7popnquuqk5jj2t@4ax.com>
Trying doing an ARTICLE <mid> command on these and see what happens
(assuming your server has them of course).
> >If you read large articles, and don't see the problem, then you have a
> >very strange bug in your code which reads the LIST ACTIVE data. To the
> >news server and to TCP/IP, there is no difference between LIST ACTIVE
> >and ARTICLE 12345.
>
> See, your notion that it was in dialup settings appealed to me. I mean,
> I wanted to believe it was in my code; that's why I was asking. However,
> I described in my original post that I could telnet to the newsserver,
> type "LIST ACTIVE" and within a short amount of time, would lose the
> connection.
Right. If you see the same problem with telnet, then it's not your code.
And you will never see that problem using telnet to any news server if
your connection is working correctly. So something in your connection
path is broken.
> I do, sometimes, now that I checked, get short, unterminated XOVER
> responses. Same thing. This was easy to code around and I did this some
> time ago. I'll have to revisit this (via telnet) and make sure it's the
> same exact thing, but I'll bet it is.
No newsreader in the world that I know of (I've written two newsreaders
and one news server), has any code to deal with truncated responses. They
just don't happen on real internet connections. TCP takes care of all
the retries on lost data so the application doesn't have to.
> I'll do more playing, but I'll also investigate settings at the
> dialup-answer end, and ask more questions about our firewall/gateway.
If you go though a firewall it's possible that's broken somehow as well.
Anything in the path could be suspect.
If I can access your server though your firewall I'll be happy to test
it for you from my (non-dialup) connection with a simple telnet. Feel free
to e-mail me if you want me to try something for you.
> I'm reluctant to call THAT the problem, as it's the same transport path
> whether I'm at work (fast, always works) or home (dialup through a work
> machine). Perhaps it's some odd buffer size combination/conflict. Since
> it isn't unqiue to my settup, I'll have to continue to explore coded
> solutions ("work arounds") too.
>
> I mean, what kinds of bugs can I have with a simple call to recv() in a
> loop? I guess I can study the code around it, but there isn't much!
If you parse the lines as you read them and do malloc()s to store the data
in some complex structures then who knows what type of pointer bugs you
might have that could cause no end of strange behavior.
But if you get the same problem doing a telnet to the NNTP server and
typing LIST ACTIVE, then there's no question that it's a problem in
the network somewhere between the server and your machine so there's
no need to suspect your application.
--
Curt Welch http://CurtWelch.Com/
curt@kcwc.com Webmaster for http://NewsReader.Com/
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