[Spread-users] REJECT_NOT_UNIQUE

Jonathan Stanton jonathan at spreadconcepts.com
Fri Dec 7 18:54:28 EST 2012


It is on by default in the 4.2 release code (as I think you found in the code). However, for it to be very useful you have to enable it (and tune some of the parameters) in your kernel. For example on Linux you will need to tune the sysctl parameters:

/sbin/sysctl -a | grep keep
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 7200


To get quick detection (otherwise it will take minutes for the keep alives to disconnect the session.

A google search for configuring your specific operating system for "turn on TCP keepalive" should find some instructions. 

Cheers,

Jonathan

-------------------------------------------------------------------------------
Jonathan Stanton		jonathan at spreadconcepts.com
Spread Group Messaging	www.spread.org
Spread Concepts LLC 	www.spreadconcepts.com
-------------------------------------------------------------------------------



On Dec 7, 2012, at 6:45 PM, Lu Liu wrote:

> Jonathan,
> 
> When you mentioned "turn on keep_alive" do you mean I need to configure this feature through
> a key word in spread.conf or something else? Looked at the code it seems when the function
> SP_connect_timeout() is used the setsockopt() will be called to enable the the keepalive option 
> of the socket. Is that right?
> 
> Thanks,
> 
> Lu 
> 
> 
> ________________________________________
> From: Jonathan Stanton [jonathan at spreadconcepts.com]
> Sent: Friday, December 07, 2012 2:40 PM
> To: Lu Liu
> Cc: spread-users at lists.spread.org
> Subject: Re: [Spread-users] REJECT_NOT_UNIQUE
> 
> When you stop a client normally, the Spread daemon gets notified that the client is disconnecting, so it removes it from it's set of active clients. Then when the client restarts it is allowed to connect.
> 
> However if you power cycle the machine, it cuts off the packets between the client process and server before the client can notify the server that it is leaving, so  it looks to the server as if nothing has happened to the client (no packets arrive from the client -- but none are expected unless the client is trying to act) so it thinks that client is still connected (and if you look at the server state, the tcp connection to the client will still be in an established state. (Note, I expect if you do a 'shutdown' of the client machine using the OS it will not have this problem as in that case the client process is killed and the tcp connection to the server is closed correctly by the OS, that is different then if you power cycle the server using the power button in which case the clean shutdown doesn't happen)
> 
> Now if the server tries to send a message to the client, it will get a tcp error and then will know to remove the client state and then can accept a new connection from that client. To get better detection of these 'idle disconnected' clients you can also turn on 'keep alives' in the newer versions of Spread. That will close the connection if probes that are sent every so many seconds are not responded to.
> 
> Cheers,
> 
> Jonathan
> 
> -------------------------------------------------------------------------------
> Jonathan Stanton                jonathan at spreadconcepts.com
> Spread Group Messaging  www.spread.org
> Spread Concepts LLC     www.spreadconcepts.com
> -------------------------------------------------------------------------------
> 
> 
> 
> On Dec 7, 2012, at 11:28 AM, Lu Liu wrote:
> 
>> Hi,
>> 
>> I am using spread 4.0.1. If I stop a client normally and restart the
>> client it connects to the server correctly.
>> But If I power cycled the client machine I got the error
>> "REJECT_NOT_UNIQUE". Any idea?
>> 
>> Thanks,
>> 
>> Lu
>> 
>> _______________________________________________
>> Spread-users mailing list
>> Spread-users at lists.spread.org
>> http://lists.spread.org/mailman/listinfo/spread-users
> 




More information about the Spread-users mailing list