grpc-js: Fix reuse of channel filter stack factory

This commit is contained in:
Michael Lumish 2022-11-10 10:54:19 -08:00
parent 24ee5a0f16
commit 0de2aad269
2 changed files with 5 additions and 1 deletions

View File

@ -88,6 +88,10 @@ export class FilterStackFactory implements FilterFactory<FilterStack> {
this.factories.unshift(...filterFactories);
}
clone(): FilterStackFactory {
return new FilterStackFactory(this.factories);
}
createFilter(): FilterStack {
return new FilterStack(
this.factories.map((factory) => factory.createFilter())

View File

@ -439,7 +439,7 @@ export class InternalChannel {
parentCall: parentCall,
};
const call = new ResolvingCall(this, method, finalOptions, this.filterStackFactory, this.credentials._getCallCredentials(), getNextCallNumber());
const call = new ResolvingCall(this, method, finalOptions, this.filterStackFactory.clone(), this.credentials._getCallCredentials(), getNextCallNumber());
if (this.channelzEnabled) {
this.callTracker.addCallStarted();