Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/6238#discussion_r199832400 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java --- @@ -151,7 +151,12 @@ public void recycle(MemorySegment segment) { this.numTotalRequiredBuffers += numRequiredBuffers; - redistributeBuffers(); + try { + redistributeBuffers(); + } catch (Throwable t) { + this.numTotalRequiredBuffers -= numRequiredBuffers; + ExceptionUtils.rethrowIOException(t); --- End diff -- After an offline discussion with Nico, we agreed that we should add this bit and additionally also call `redistributeBuffers` in the failure case in `requestMemorySegments`.
---