Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ public synchronized ExecutorService get(String name) {

public synchronized ExecutorService get(String name, int maxSize) {
checkState(!stopped.get(), "already stopped");
ExecutorService service = Executors.newFixedThreadPool(
ExecutorService service = new ThreadPoolExecutor(
1,
maxSize,
60L,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
new ThreadFactoryBuilder().setNameFormat(name + "-%d").build()
);
executorPools.add(service);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,10 @@ public void write(OutputStream output) throws WebApplicationException, IOExcepti
requestBuilder.execute(this).get();
} catch (ExecutionException | InterruptedException e) {
LOG.error("Failed or interrupted while proxying a download from Mesos", e);
} finally {
if (wrappedOutputStream != null) {
wrappedOutputStream.close();
}
}
}
}
Expand Down