-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sdk#1111] Fix sendfd
issue on URL change
#1112
[sdk#1111] Fix sendfd
issue on URL change
#1112
Conversation
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
append( | ||
opts.additionalFunctionality, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of URL change dial.Client
does the following on Request:
- Close old URL.
- Request new URL.
If we have sendfd.Client
in the chain before it does the following on Request:
- insert
grpcfd.PerRPCCredentials
to the call options.
grpcfd.PerRPCCredentials
does the following:
- Store fds that needs to be sent.
- On first gRPC interaction send them and remember connection as a
FDTransceiver
. - Cleanup all stored fds.
So it results in the following:
dial
closes old URL -PerRPCCredentials
sends all fds to the old URL.dial
requests new URL -PerRPCCredentials
has nothing to send so it does nothing.
So here are 2 solutions that I can currently see:
- Put
dial
client beforeadditionalFunctionality
. - Edit
PerRPCCredentials
not to captureFDTransceiver
and not to cleanup stored fds on send.
We have discussed this with @edwarnicke and so it actually looks like both of these solutions have their pros and cons, but [1] is easier to implement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@denis-tingaikin I discussed this this morning with @Bolodya1997 on slack. It's a subtle bug, but once explained it makes sense.
@@ -48,7 +48,7 @@ func NewClient() networkservice.NetworkServiceClient { | |||
func (r *recvFDClient) Request(ctx context.Context, request *networkservice.NetworkServiceRequest, opts ...grpc.CallOption) (*networkservice.Connection, error) { | |||
// Get the grpcfd.FDRecver | |||
rpcCredentials := grpcfd.PerRPCCredentials(grpcfd.PerRPCCredentialsFromCallOptions(opts...)) | |||
opts = append(opts, grpc.PerRPCCredentials(rpcCredentials)) | |||
opts = append([]grpc.CallOption{grpc.PerRPCCredentials(rpcCredentials)}, opts...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to change the order of call options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault, I did a mistake during the testing, there is no need for this.
func TestSelectEndpointServer_CleanRequest(t *testing.T) { | ||
t.Cleanup(func() { goleak.VerifyNone(t) }) | ||
|
||
var flag bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use a more understandable name?
var flag bool | |
var TODO bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with hasBeenRequested
.
This reverts commit d14a71d. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1112 Commit: a94971d Author: Vladimir Popov Date: 2021-10-20 21:43:53 +0700 Message: - [sdk#1111] Fix `sendfd` issue on URL change (#1112) * Set dial client before additional functionality in client chain Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix recvfd/senfd clients Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Clone request in remote iteration points Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add multiforwarder sendfd test Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Revert "Fix recvfd/senfd clients" This reverts commit d14a71d11a2561b847d73dc6ae17f9394fa12125. Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Fix naming Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Description
roundrobin
,interpose
,discover
.dial
beforeadditionalFunctionality
in client chain.opts
insendfd
,recvfd
clients.Issue link
Closes #1111.
How Has This Been Tested?
Types of changes