[Spread-users] clients blocked at startup in partial cluster?

Roberto.Diaz at fastmobile.com Roberto.Diaz at fastmobile.com
Wed Oct 19 09:34:23 EDT 2005

i had a big time issue with SpreadConnection in this regard.
specifically, when the spread daemon was not up and running my app tried
joining a group, it would hang or would throw an exception and my app
would not work properly.

i ended up creating a subclass of SpreadConnection for my own use. this
class tries to connect and if unsuccessful, it tries to reconnect every
so often until it succeeds. that way, my app can just create one of
these and continue execution -- safe in the knowledge that (eventually)
it would connect to the spread daemon. 

a nice side benefit of how the subclass is written is that if the spread
daemon ever goes away, this new subclass automatically reconnects (and
keeps trying to reconnect until successful). 

since my app needs to send regular messages into the spread group when
it first connects, the subclass i created uses a call back to notify
registered listeners whenever the spread daemon gets connected or

btw- to make this work, i had to modify SpreadConnection, and ended up
upgrading it to jdk1.5 while i was at it. thus, it's a non-standard
SpreadConnection class. but that's ok since it's only for my use. :-)

Roberto Diaz
Roberto.Diaz at fastmobile.com

> -----Original Message-----
> From: spread-users-bounces at lists.spread.org 
> [mailto:spread-users-bounces at lists.spread.org] On Behalf Of toby cabot
> Sent: Tuesday, October 18, 2005 4:46 PM
> To: spread-users at lists.spread.org
> Subject: [Spread-users] clients blocked at startup in partial cluster?
> Hi folks,
> I'm seeing some "interesting" behavior from Spread on Linux 
> and wanted to check if it's normal or something we want to 
> look into.  I've got a two-node cluster that uses Spread to 
> decide which node is active and which is backup.  If I start 
> either node with the network cable unplugged then Java 
> clients block when they try to connect to Spread:
> "main" prio=1 tid=0x0805ad70 nid=0x30cb runnable [bfffd000..bfffd87c]
> 	at java.net.SocketInputStream.socketRead0(Native Method)
> 	at java.net.SocketInputStream.read(SocketInputStream.java:129)
> 	at java.net.SocketInputStream.read(SocketInputStream.java:182)
> 	at 
> spread.SpreadConnection.readAuthMethods(SpreadConnection.java:433)
> 	at spread.SpreadConnection.connect(SpreadConnection.java:856)
> 	- locked <0x447e3f20> (a spread.SpreadConnection)
> The client blocks until the network cable is plugged in, at 
> which point it proceeds.  The client is connecting to localhost, i.e.
>   spread = new SpreadConnection();
>   spread.connect(InetAddress.getByName(""), port, 
> name, false, true);
> Is this behavior expected or have I got something mis-configured?
> Thanks,
> Toby Cabot
> PS.  Spread.conf contains:
> Spread_Segment {
>       prfx4
>       prfx1
> }
> _______________________________________________
> 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