-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use context during client dial #343
Labels
bug
Something isn't working
client
Issue related to the client
enhancement
Improving existing functionality
U3
Regular
Milestone
Comments
cthulhu-rider
added
enhancement
Improving existing functionality
client
Issue related to the client
and removed
triage
labels
Oct 3, 2022
cthulhu-rider
added a commit
to cthulhu-rider/neofs-sdk-go
that referenced
this issue
Oct 3, 2022
In previous implementation of `Client.Dial` there was no ability to specify parent context (e.g. global application context). Add `PrmDial.SetContext` method which accepts optional base dial context. Use the context to open client connection or fall back to using `context.Background()`. Upgraded version of `github.com/nspcc-dev/neofs-api-go/v2` module also fixes the problem when dial timeout didn't work properly.
cthulhu-rider
added a commit
to cthulhu-rider/neofs-sdk-go
that referenced
this issue
Oct 3, 2022
After recent changes `client.Client` accepts dial context. There is a need to forward the context passed into `Pool.Dial` to the underlying `Client` instances. Define type aliases of different client constructors: context-based and non-context. Use context-based constructor in `Pool`. Pass `ctx` parameter of `Pool.Dial` method to the client builder.
cthulhu-rider
added a commit
to cthulhu-rider/neofs-sdk-go
that referenced
this issue
Oct 3, 2022
In previous implementation of `Client.Dial` there was no ability to specify parent context (e.g. global application context). Add `PrmDial.SetContext` method which accepts optional base dial context. Use the context to open client connection or fall back to using `context.Background()`. Upgraded version of `github.com/nspcc-dev/neofs-api-go/v2` module also fixes the problem when dial timeout didn't work properly. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
cthulhu-rider
added a commit
to cthulhu-rider/neofs-sdk-go
that referenced
this issue
Oct 3, 2022
After recent changes `client.Client` accepts dial context. There is a need to forward the context passed into `Pool.Dial` to the underlying `Client` instances. Define type aliases of different client constructors: context-based and non-context. Use context-based constructor in `Pool`. Pass `ctx` parameter of `Pool.Dial` method to the client builder. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
cthulhu-rider
added a commit
to cthulhu-rider/neofs-sdk-go
that referenced
this issue
Oct 5, 2022
In previous implementation of `Client.Dial` there was no ability to specify parent context (e.g. global application context). Add `PrmDial.SetContext` method which accepts optional base dial context. Use the context to open client connection or fall back to using `context.Background()`. Upgraded version of `github.com/nspcc-dev/neofs-api-go/v2` module also fixes the problem when dial timeout didn't work properly. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
cthulhu-rider
added a commit
to cthulhu-rider/neofs-sdk-go
that referenced
this issue
Oct 5, 2022
After recent changes `client.Client` accepts dial context. There is a need to forward the context passed into `Pool.Dial` to the underlying `Client` instances. Define type aliases of different client constructors: context-based and non-context. Use context-based constructor in `Pool`. Pass `ctx` parameter of `Pool.Dial` method to the client builder. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
client
Issue related to the client
enhancement
Improving existing functionality
U3
Regular
Problem
Client's
Dial()
does not process application level context.neofs-sdk-go/client/client.go
Line 73 in 8e3173e
neofs-sdk-go/client/client.go
Lines 167 to 177 in 8e3173e
If connection can't be established, application may freeze until timeout (20 seconds) and it will ignore closed application context. See (nspcc-dev/neofs-s3-gw#712)
Solution
Pass context into
Dial
function and use it during initial balance request asclient.WithContext()
option. It worked in PoC: (nspcc-dev/neofs-s3-gw#712 (comment))The text was updated successfully, but these errors were encountered: