Copilot commented on code in PR #10772:
URL: https://github.com/apache/ozone/pull/10772#discussion_r3584443959


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/defrag/TestSnapshotDefragService.java:
##########
@@ -224,6 +236,83 @@ private String getFromCodecBuffer(CodecBuffer buffer) {
     return StringCodec.get().fromCodecBuffer(buffer);
   }
 
+  private void putString(Table<String, CodecBuffer> table, String key,
+      String value) throws RocksDatabaseException, CodecException {
+    table.put(key, StringCodec.get().toDirectCodecBuffer(value));
+  }

Review Comment:
   putString allocates a direct CodecBuffer via 
StringCodec.get().toDirectCodecBuffer(value) but never closes it. Because this 
table uses StringCodec as the key codec, TypedTable.supportCodecBuffer is 
false, so the table will serialize the provided CodecBuffer via 
CodecBufferCodec.toPersistedFormat without taking ownership. This leaks 
direct/off-heap buffers across the test run.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to