You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "reswqa (via GitHub)" <gi...@apache.org> on 2023/03/29 04:07:08 UTC

[GitHub] [flink] reswqa commented on a diff in pull request #22280: [FLINK-31626] HsSubpartitionFileReaderImpl should recycle skipped read buffers.

reswqa commented on code in PR #22280:
URL: https://github.com/apache/flink/pull/22280#discussion_r1151370945


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/HsSubpartitionFileReaderImpl.java:
##########
@@ -251,6 +273,18 @@ public Buffer.DataType peekNextToConsumeDataType(int nextBufferToConsume) {
 
     @Override
     public void releaseDataView() {
+        Queue<Buffer> bufferToRecycle = new ArrayDeque<>();
+        synchronized (lock) {
+            isReleased = true;
+            // all loaded buffers should be recycled after data view released.
+            while (!loadedBuffers.isEmpty()) {
+                BufferIndexOrError bufferIndexOrError = loadedBuffers.poll();

Review Comment:
   Yes, It is for the purpose of deadlocking.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org