Skip to content

Commit 90a8057

Browse files
committed
tweak: do not fail back in unless failover is enabled
1 parent e507ab3 commit 90a8057

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/com/danga/MemCached/SockIOPool.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public class SockIOPool {
136136
private Map createShift;
137137

138138
// initial, min and max pool sizes
139-
private final int poolMultiplier = 4;
139+
private int poolMultiplier = 4;
140140
private int initConn = 3;
141141
private int minConn = 3;
142142
private int maxConn = 10;
@@ -532,7 +532,8 @@ protected SockIO createSocket( String host ) {
532532

533533
// if host is dead, then we don't need to try again
534534
// until the dead status has expired
535-
if ( hostDead.containsKey( host ) && hostDeadDur.containsKey( host ) ) {
535+
// we do not try to put back in if failover is off
536+
if ( failover && hostDead.containsKey( host ) && hostDeadDur.containsKey( host ) ) {
536537

537538
Date store = (Date)hostDead.get( host );
538539
long expire = ((Long)hostDeadDur.get( host )).longValue();
@@ -1138,7 +1139,7 @@ public void run() {
11381139

11391140
while ( !this.stopThread ) {
11401141
try {
1141-
this.sleep( interval );
1142+
Thread.sleep( interval );
11421143

11431144
// if pool is initialized, then
11441145
// run the maintenance method on itself

0 commit comments

Comments
 (0)