Skip to content

Commit

Permalink
Ensure all page buffer clients are closed
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Feb 8, 2014
1 parent e4e86cb commit 5374db4
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -16,7 +16,6 @@
import com.facebook.presto.operator.HttpPageBufferClient.ClientCallback;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
import com.google.common.io.Closeables;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture;
Expand Down Expand Up @@ -203,7 +202,7 @@ public synchronized void close()
{
closed.set(true);
for (HttpPageBufferClient client : allClients.values()) {
Closeables.closeQuietly(client);
closeQuietly(client);
}
pageBuffer.clear();
bufferBytes = 0;
Expand Down Expand Up @@ -344,4 +343,14 @@ public void clientFinished(HttpPageBufferClient client)
ExchangeClient.this.clientFinished(client);
}
}

private static void closeQuietly(HttpPageBufferClient client)
{
try {
client.close();
}
catch (RuntimeException e) {
// ignored
}
}
}

0 comments on commit 5374db4

Please sign in to comment.