Skip to content

Commit 7db817f

Browse files
author
mengli
committed
Fix OutofMemory bug when the memcached server is down.
1 parent b79b951 commit 7db817f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/com/schooner/MemCached/SchoonerSockIOPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ protected final SchoonerSockIO createSocketWithAdd(String host) {
406406
socket = new UDPSockIO(this, host, bufferSize, socketTO);
407407
}
408408
} catch (Exception ex) {
409-
poolCurrentConn.get(host).decrementAndGet();
410409
log.error("++++ failed to get SockIO obj for: " + host);
411410
// log.error(ex.getMessage(), ex);
412411
socket = null;
@@ -541,6 +540,7 @@ public final SchoonerSockIO getConnection(String host) {
541540
ConcurrentLinkedQueue<SchoonerSockIO> sockets = socketPool.get(host);
542541
SchoonerSockIO socket = sockets.poll();
543542
if (socket == null) {
543+
System.out.println(poolCurrentConn.get(host).get());
544544
if (poolCurrentConn.get(host).get() < maxConn) {
545545
socket = createSocketWithAdd(host);
546546
} else {

0 commit comments

Comments
 (0)