org.jgroups.protocols
Class FD_SOCK
- Runnable
public class FD_SOCK
implements Runnable
Failure detection protocol based on sockets. Failure detection is ring-based. Each member creates a
server socket and announces its address together with the server socket's address in a multicast. A
pinger thread will be started when the membership goes above 1 and will be stopped when it drops below
2. The pinger thread connects to its neighbor on the right and waits until the socket is closed. When
the socket is closed by the monitored peer in an abnormal fashion (IOException), the neighbor will be
suspected.
The main feature of this protocol is that no ping messages need to be exchanged between
any 2 peers, and failure detection relies entirely on TCP sockets. The advantage is that no activity
will take place between 2 peers as long as they are alive (i.e. have their server sockets open).
The disadvantage is that hung servers or crashed routers will not cause sockets to be closed, therefore
they won't be detected.
The FD_SOCK protocol will work for groups where members are on different hosts
The costs involved are 2 additional threads: one that
monitors the client side of the socket connection (to monitor a peer) and another one that manages the
server socket. However, those threads will be idle as long as both peers are running.
down_handler , down_prot , down_queue , down_thread , down_thread_prio , log , observer , props , stack , stats , trace , up_handler , up_prot , up_queue , up_thread , up_thread_prio , warn |
destroy , down , downThreadEnabled , dumpStats , enableStats , getDownProtocol , getDownQueue , getName , getProperties , getUpProtocol , getUpQueue , handleSpecialDownEvent , init , isTrace , isWarn , passDown , passUp , printStats , providedDownServices , providedUpServices , receiveDownEvent , receiveUpEvent , requiredDownServices , requiredUpServices , resetStats , setDownProtocol , setObserver , setProperties , setPropertiesInternal , setProtocolStack , setTrace , setUpProtocol , setWarn , start , startDownHandler , startUpHandler , statsEnabled , stop , stopInternal , up , upThreadEnabled |
getLocalAddress
public String getLocalAddress()
getMembers
public String getMembers()
getNumSuspectEventsGenerated
public int getNumSuspectEventsGenerated()
getPingDest
public String getPingDest()
getPingableMembers
public String getPingableMembers()
init
public void init()
throws Exception
- init in interface Protocol
printSuspectHistory
public String printSuspectHistory()
run
public void run()
Runs as long as there are 2 members and more. Determines the member to be monitored and fetches its
server socket address (if n/a, sends a message to obtain it). The creates a client socket and listens on
it until the connection breaks. If it breaks, emits a SUSPECT message. It the connection is closed regularly,
nothing happens. In both cases, a new member to be monitored will be chosen and monitoring continues (unless
there are fewer than 2 members).
Copyright B) 1998-2005 Bela Ban. All Rights Reserved.