File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
ambry-router/src/main/java/com.github.ambry.router Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -433,8 +433,6 @@ private void maybeWriteToChannel() {
433433 */
434434 void completeRead () {
435435 if (readIntoCallbackCalled .compareAndSet (false , true )) {
436- chunkIndexToResponseInfo .values ().forEach (ResponseInfo ::release );
437- chunkIndexToResponseInfo .clear ();
438436 Exception e = operationException .get ();
439437 readIntoFuture .done (bytesWritten .get (), e );
440438 if (readIntoCallback != null ) {
@@ -451,6 +449,12 @@ void completeRead() {
451449 } else {
452450 routerMetrics .getBlobOperationTotalTimeMs .update (totalTime );
453451 }
452+ for (Integer key : chunkIndexToResponseInfo .keySet ()) {
453+ ResponseInfo response = chunkIndexToResponseInfo .remove (key );
454+ if (response != null ) {
455+ response .release ();
456+ }
457+ }
454458 }
455459 operationCompleted = true ;
456460 }
You can’t perform that action at this time.
0 commit comments