This is an automated email from the ASF dual-hosted git repository. kenhuuu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 4e64fcbb65f6d6e83d3d6e43e1d8ae0dd22a9f3f Author: Ken Hu <[email protected]> AuthorDate: Tue Jun 23 15:20:20 2026 -0700 Release pooled ByteBuf when a TypeSerializer throws unchecked CTR Only IOException was caught, so an unchecked failure from a custom serializer leaked the buffer. Assisted-by: Claude Code:claude-opus-4-8 --- .../tinkerpop/gremlin/util/ser/GraphBinaryMessageSerializerV4.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphBinaryMessageSerializerV4.java b/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphBinaryMessageSerializerV4.java index 6f2e4c657f..06ee8b233c 100644 --- a/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphBinaryMessageSerializerV4.java +++ b/gremlin-util/src/main/java/org/apache/tinkerpop/gremlin/util/ser/GraphBinaryMessageSerializerV4.java @@ -202,9 +202,10 @@ public class GraphBinaryMessageSerializerV4 extends AbstractMessageSerializer<Gr // Nullable exception writer.writeValue(status.getException(), buffer, true); } - } catch (IOException e) { + } catch (Throwable t) { + // Catch Throwable so a TypeSerializer throwing an unchecked exception can't leak the pooled byteBuf. byteBuf.release(); - throw new SerializationException(e); + throw new SerializationException(t); } return byteBuf; }
