-
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
Fix timeout/expire chain elements #1404
Fix timeout/expire chain elements #1404
Conversation
aed2dbe
to
dc57328
Compare
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
dc57328
to
e94ae98
Compare
if withNSEExpiration { | ||
builder = builder.SetRegistryExpiryDuration(time.Second / 2) | ||
} | ||
|
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 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.
We now rely mostly on the token rather than registryExpirationDuration. Therefore, below we create a token with the expiration we need.
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.
Got it
@@ -32,35 +32,38 @@ import ( | |||
) | |||
|
|||
type expireNSEServer struct { | |||
nseExpiration time.Duration | |||
ctx context.Context | |||
defaultNseExpiration time.Duration |
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.
Should we get rid of default expiration? Seems like the update path is going to always put the expiration time for nses after these changes.
defaultNseExpiration time.Duration |
For unit tests, we can add injectexpirationtime
chain element.
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.
Totally agree
But should we consider the situation where the user hasn't updatepath
?
2d231f6
to
3d91c09
Compare
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
3d91c09
to
430d162
Compare
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1404 Commit: d41eaac Author: Artem Glazychev Date: 2022-12-29 08:57:32 +0700 Message: - Fix timeout/expire chain elements (#1404) * Fix timeout/expire chain elements Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> * Remove default expiration for registry Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
With networkservicemesh/sdk#1404 NSE expiration time is controlled by NSM's MaxTokenLifetime parameter (defaults to 10 minutes). Introduce a custom chain function to ensure LB/Proxy NSEs are registered using 1 minute lifetime like before.
With networkservicemesh/sdk#1404 NSE expiration time is controlled by NSM's MaxTokenLifetime parameter (defaults to 10 minutes). Introduce a custom chain function to ensure LB/Proxy NSEs are registered using 1 minute lifetime like before.
Signed-off-by: Artem Glazychev artem.glazychev@xored.com
Description
Main changes:
Close()
ontimeout
, the token may already be expired. Therefore, we need to callClose()
in advance -(tokenTimeout - requestTimeout)
min(peertoken.ExpirationTime, token.ExpirationTime, nse.ExpirationTIme) - registerTimeout
.grpc.Header
was added toUnregister()
to process an updatedpath
on the way back (like here - https://github.com/networkservicemesh/sdk/blob/main/pkg/registry/common/grpcmetadata/nse_client.go#L47-L48)begin
, because in case of an event that triggers aneventFactory
, we don't need to re-authorize.path
, since we access it by reference (we should not be able to accidentally change it afterbegin
)Issue link
#1398
How Has This Been Tested?
Types of changes