Fault tolerance Java Client

iabelle LE SAEC isabelle.le.saec at gmail.com
Mon Apr 18 08:43:07 PDT 2005


Hi,

For fault tolerance reasons we
intend to use several memcached servers and rely upon the rehashing
capabilities of JAVA APIs. (failover is true)
The client fails to connect to one of the server with Connection Time
out , due to an acces list .

The log is:
com.danga.MemCached.SockIOPool Mon Apr 18 16:33:19 CEST 2005 - ++++
failed to get SockIO obj for: 10.154.51.3:11211
com.danga.MemCached.SockIOPool Mon Apr 18 16:33:19 CEST 2005 -
Connection timed out


The code in Java reads in createSocket:
	try {
			socket = new SockIO(host, this.socketTO, this.nagle);

			if (!socket.isConnected()) {
				log.error("++++ failed to get SockIO obj for: " + host + " -- new
socket is not connected");
				try {
					socket.trueClose();
				}
				catch (Exception ex) {
					log.error("++++ failed to close SockIO obj for server: " + host);
					log.error(ex.getMessage(), ex);
					socket = null;
				}
			}
		}
		catch (Exception ex) {
			log.error("++++ failed to get SockIO obj for: " + host);
			log.error(ex.getMessage(), ex);
		}


My question is:
why don't we mark the host dead in the case of catching Exception when
instanciating the  SockIO object?




Isabelle


More information about the memcached mailing list