Merge pull request #2271 from murgatroid99/grpc-js_filter_factory_reuse_fix

grpc-js: Fix reuse of channel filter stack factory
This commit is contained in:
Michael Lumish 2022-11-10 11:43:39 -08:00 committed by GitHub
commit dda62637d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();