[Spread-users] Problems with connection timeouts ...

Jonathan Stanton jonathan at cnds.jhu.edu
Sat May 14 18:09:22 EDT 2005


Spread itself never times out connections. The only time it closes a 
connection is if one of the following occurs:

1) The client program calls SP_disconnect() (which is slightly cleaner 
then just closing the socket directly on the client side, but 
essentially has the same effect).

2) the daemon receives a non-recoverable socket error from the OS when 
it tries to read or write to the socket to the client. In this case the 
socket (and corresponding tcp connection) are no longer valid so the 
deamon closes it's end and cleans it up.

3) If the daemon has been delivering messages to the client app, but the 
client has not been reading the messages. The daemon will buffer upto a 
thousand or so messages (configurable at runtime) and then disconnect 
the connection if the client is still not reading messages.

Given what you have said I'm guessing either 2 or 3 is occuring. If you 
turn on SESSION logging in the daemon spread.conf file then the daemon 
will log why it is closing connections. 

If 2 is occuring, it could be that your OS tcp stack is itself closing 
idle tcp connections (some OS's have a feature to do this) or you have 
intermittent network errors which cause the connection to be dropped 
when the error occurs and only noticed the next time the app or daemon 
go to send a message.

If 3 is occuring, then the problem is that you are not reading messages 
that are delivered to you. If you have a program that is only sending 
messages to a group, it should not join the group. You can send to a 
group without being a member. You only need to join if you want to 
recevie the messages sent to the group. 

Given the low rate of messages you describe, I wouldn't believe it is
actually a flow-control issue with sending too fast (which does happen
to other spread apps and you can read discussions about flow control in
the archives of the spread-users list).

Hope this helps. If this doesn't fix it, email the list back with more 
details about what error you are getting and any session logs and we can 
try to help.


On Sat, May 14, 2005 at 09:57:46AM +0200, Hans-Juergen Schoenig wrote:
> I have been using Spread for some weeks now.
> My problem is that we have extemely long living sessions but hardly traffic.
> I can easily happen that a Spread session stays open for some time 
> without receiving or sending data.
> The traffic distributed by Spread is more or less random (as far as 
> timing is concerned).
> My problem is that Spread closes the connection after some time. This 
> will make my application do a nice little core dump.
> How can I make sure that connections stay open forever or until they are 
> shut down properly? Is there some sort of timeout parameter?
>    best regards,
>       hans
> _______________________________________________
> Spread-users mailing list
> Spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users

Jonathan R. Stanton         jonathan at cs.jhu.edu
Dept. of Computer Science   
Johns Hopkins University    

More information about the Spread-users mailing list