mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Merge pull request #1273 from murgatroid99/grpc-js_pick_error_handling
Clone metadata going into the metadata filter stack
This commit is contained in:
commit
7a4c52b572
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@grpc/grpc-js",
|
||||
"version": "0.6.17",
|
||||
"version": "0.6.18",
|
||||
"description": "gRPC Library for Node - pure JS implementation",
|
||||
"homepage": "https://grpc.io/",
|
||||
"repository": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js",
|
||||
|
||||
@ -250,8 +250,11 @@ export class ChannelImplementation implements Channel {
|
||||
this.pickQueue.push({ callStream, callMetadata });
|
||||
break;
|
||||
}
|
||||
/* We need to clone the callMetadata here because the transparent
|
||||
* retry code in the promise resolution handler use the same
|
||||
* callMetadata object, so it needs to stay unmodified */
|
||||
callStream.filterStack
|
||||
.sendMetadata(Promise.resolve(callMetadata))
|
||||
.sendMetadata(Promise.resolve(callMetadata.clone()))
|
||||
.then(
|
||||
finalMetadata => {
|
||||
const subchannelState: ConnectivityState = pickResult.subchannel!.getConnectivityState();
|
||||
@ -280,6 +283,8 @@ export class ChannelImplementation implements Channel {
|
||||
'channel',
|
||||
'Failed to start call on picked subchannel ' +
|
||||
pickResult.subchannel!.getAddress() +
|
||||
' with error ' +
|
||||
(error as Error).message +
|
||||
'. Retrying pick'
|
||||
);
|
||||
this.tryPick(callStream, callMetadata);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user