grpc-js: Discard buffer tracker entry when RetryingCall ends

This commit is contained in:
Michael Lumish 2023-01-03 09:53:00 -08:00
parent c9f8f93a74
commit c62d41623b
1 changed files with 9 additions and 0 deletions

View File

@ -202,6 +202,15 @@ export class RetryingCall implements Call {
private reportStatus(statusObject: StatusObject) {
this.trace('ended with status: code=' + statusObject.code + ' details="' + statusObject.details + '"');
this.bufferTracker.freeAll(this.callNumber);
for (let i = 0; i < this.writeBuffer.length; i++) {
if (this.writeBuffer[i].entryType === 'MESSAGE') {
this.writeBuffer[i] = {
entryType: 'FREED',
allocated: false
};
}
}
process.nextTick(() => {
this.listener?.onReceiveStatus(statusObject);
});