Source:
<code>private void handleIO(SelectionKey sk) { MemcachedNode qa=(MemcachedNode)sk.attachment(); try { getLogger().debug( "Handling IO for: %s (r=%s, w=%s, c=%s, op=%s)", sk, sk.isReadable(), sk.isWritable(), sk.isConnectable(), sk.attachment()); if(sk.isConnectable()) { getLogger().info("Connection state changed for %s", sk); final SocketChannel channel=qa.getChannel(); if(channel.finishConnect()) { connected(qa); addedQueue.offer(qa); if(qa.getWbuf().hasRemaining()) { handleWrites(sk, qa); } } else { assert !channel.isConnected() : "connected"; } } else { if(sk.isValid() && sk.isReadable()) { handleReads(sk, qa); } if(sk.isValid() && sk.isWritable()) { handleWrites(sk, qa); } } } catch(ClosedChannelException e) { if(!shutDown) { getLogger().info("Closed channel and not shutting down. " + "Queueing reconnect on %s", qa, e); lostConnection(qa, ReconnDelay.DEFAULT, "closed channel"); } } catch(ConnectException e) { getLogger().info("Reconnecting due to failure to connect to %s", qa, e); queueReconnect(qa, ReconnDelay.DEFAULT, "failure to connect"); } catch (OperationException e) { qa.setupForAuth("due to authentication failure"); getLogger().info("Reconnection due to exception " + "handling a memcached operation on %s. " + "This may be due to an authentication failure.", qa, e); <START> lostConnection(qa, ReconnDelay.IMMEDIATE, "due to authentication failure"); <END> } catch(Exception e) { qa.setupForAuth("due to exception"); getLogger().info("Reconnecting due to exception on %s", qa, e); lostConnection(qa, ReconnDelay.DEFAULT, "due to exception"); } qa.fixupOps(); }</code><technical_language>"authentication failure"</technical_language>

Target:
private void handleIO(SelectionKey sk) { MemcachedNode qa=(MemcachedNode)sk.attachment(); try { getLogger().debug( "Handling IO for: %s (r=%s, w=%s, c=%s, op=%s)", sk, sk.isReadable(), sk.isWritable(), sk.isConnectable(), sk.attachment()); if(sk.isConnectable()) { getLogger().info("Connection state changed for %s", sk); final SocketChannel channel=qa.getChannel(); if(channel.finishConnect()) { connected(qa); addedQueue.offer(qa); if(qa.getWbuf().hasRemaining()) { handleWrites(sk, qa); } } else { assert !channel.isConnected() : "connected"; } } else { if(sk.isValid() && sk.isReadable()) { handleReads(sk, qa); } if(sk.isValid() && sk.isWritable()) { handleWrites(sk, qa); } } } catch(ClosedChannelException e) { if(!shutDown) { getLogger().info("Closed channel and not shutting down. " + "Queueing reconnect on %s", qa, e); lostConnection(qa, ReconnDelay.DEFAULT, "closed channel"); } } catch(ConnectException e) { getLogger().info("Reconnecting due to failure to connect to %s", qa, e); queueReconnect(qa, ReconnDelay.DEFAULT, "failure to connect"); } catch (OperationException e) { qa.setupForAuth("authentication failure"); getLogger().info("Reconnection due to exception " + "handling a memcached operation on %s. " + "This may be due to an authentication failure.", qa, e); lostConnection(qa, ReconnDelay.IMMEDIATE, "authentication failure"); } catch(Exception e) { qa.setupForAuth("due to exception"); getLogger().info("Reconnecting due to exception on %s", qa, e); lostConnection(qa, ReconnDelay.DEFAULT, "exception" + e); } qa.fixupOps(); }