Skip to content

Commit 11e56ba

Browse files
Merge branch 'kserve_main' into 20230626_sync_main
Signed-off-by: Vaibhav Jain <[email protected]>
2 parents f7ddbd9 + c4fc041 commit 11e56ba

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Build
33
on:
44
pull_request:
55
branches:
6-
- main
76
- "release-[0-9].[0-9]+"
87
paths-ignore:
98
- "**.md"

src/main/java/com/ibm/watson/modelmesh/ModelMeshApi.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,14 +768,17 @@ public void onHalfClose() {
768768
evictMethodDescriptor(methodName);
769769
}
770770
} finally {
771+
final boolean releaseResponse = status != OK;
771772
if (payloadProcessor != null) {
772773
ByteBuf data = null;
773774
Metadata metadata = null;
774775
if (response != null) {
775776
data = response.data.readerIndex(respReaderIndex);
776777
metadata = response.metadata;
777778
}
778-
processPayload(data, requestId, modelId, methodName, metadata, status, false);
779+
processPayload(data, requestId, modelId, methodName, metadata, status, releaseResponse);
780+
} else if (releaseResponse && response != null) {
781+
response.release();
779782
}
780783
ReleaseAfterResponse.releaseAll();
781784
clearThreadLocals();
@@ -805,7 +808,7 @@ private void processPayload(ByteBuf data, String payloadId, String modelId, Stri
805808
try {
806809
assert payloadProcessor != null;
807810
if (!takeOwnership) {
808-
data.retain();
811+
ReferenceCountUtil.retain(data);
809812
}
810813
payload = new Payload(payloadId, modelId, methodName, metadata, data, status);
811814
if (payloadProcessor.process(payload)) {

0 commit comments

Comments
 (0)