Skip to content

Commit 6b1c3bd

Browse files
committed
release immediately for client connection manager
1 parent 390e6d3 commit 6b1c3bd

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/main/java/software/amazon/awssdk/crt/http/HttpClientConnectionManager.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ public CompletableFuture<HttpClientConnection> acquireConnection() {
162162
}
163163

164164
CompletableFuture<HttpClientConnection> returnedFuture = new CompletableFuture<>();
165-
/* Futures need to add a ref so the HttpClientConnectionManager doesn't clean up from underneath the Future. */
166-
this.addRef();
167-
/* This insures that whether a CompletableFuture completes or throws an exception, we remove the ref it added. */
168-
returnedFuture.whenComplete((conn, ex) -> decRef());
169165
httpClientConnectionManagerAcquireConnection(this.getNativeHandle(), returnedFuture);
170166
return returnedFuture;
171167
}
@@ -193,7 +189,7 @@ private void onShutdownComplete() {
193189
* Resources that wait are responsible for calling releaseReferences() manually.
194190
*/
195191
@Override
196-
protected boolean canReleaseReferencesImmediately() { return false; }
192+
protected boolean canReleaseReferencesImmediately() { return true; }
197193

198194
/**
199195
* Closes this Connection Pool and any pending Connection Acquisitions

0 commit comments

Comments
 (0)