Skip to content
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

feat: Add "retry" networkservice.Client wrapper for nscs #1129

Merged

Conversation

denis-tingaikin
Copy link
Member

Signed-off-by: Denis Tingaikin denis.tingajkin@xored.com

Issue link

#1123

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>
Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>
Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>
type Option func(*retryClient)

// WithSettings sets retry policy settings for the retry.Client instance.
func WithSettings(s Settings) Option {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do this as standard options like

retry.WithInterval
retry.WithTryTimeout

instead of 'Settings'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.


// Settings represents retry policy settings.
type Settings struct {
Timeout time.Duration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have timeout here instead of simply using the ctx passes into the RPC calls as normal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

for ctx.Err() == nil {
requestCtx, cancel := c.WithTimeout(ctx, r.TryTimeout)
resp, err := r.client.Request(requestCtx, request, opts...)
cancel()
Copy link
Member

@edwarnicke edwarnicke Oct 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
cancel()
defer cancel()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

Signed-off-by: denis-tingaikin <denis.tingajkin@xored.com>
@edwarnicke edwarnicke merged commit 0eabc52 into networkservicemesh:main Nov 2, 2021
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Nov 2, 2021
…k@main

PR link: networkservicemesh/sdk#1129

Commit: 0eabc52
Author: Denis Tingaikin
Date: 2021-11-02 04:35:19 +0300
Message:
  - feat: Add "retry" networkservice.Client wrapper for nscs (#1129)
* add re-try networkservice.Client wrapper

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* fix linter issue

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* update default values after manul testing

Signed-off-by: Denis Tingaikin <denis.tingajkin@xored.com>

* apply review comments

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants