-
Notifications
You must be signed in to change notification settings - Fork 14
Connect timeout #295
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
base: main
Are you sure you want to change the base?
Connect timeout #295
Conversation
|
||
// Parse optional parameters | ||
for _, option := range options { | ||
switch v := option.(type) { |
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 we checking based on the type ?
DefaultBackoffMaxDelay int = 60 | ||
DefaultBackoffDelayFactor float64 = 3 | ||
DefaultGnmiTimeout time.Duration = 15 * time.Second // Configurable gNMI timeout | ||
DefaultConnectTimeout time.Duration = 30 * time.Second // Configurable connection timeout |
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.
Can you explain what the issue you try to slove and why we have two timeout ?
cancel() // Clean up timeout context immediately | ||
|
||
if err != nil { | ||
c.Devices[device].SetMutex.Unlock() |
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.
The device unlock is already handled in the following lines.
c.Devices[device].SetMutex.Lock() | ||
if !c.ReuseConnection { | ||
err = target.CreateGNMIClient(ctx) | ||
// Create connection context with configurable timeout |
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.
Not sure why we’re adding two timeouts for the same gNMI call—check line 195.
Connection timeout for gnmi connection for user to connect