-
Notifications
You must be signed in to change notification settings - Fork 125
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
Runtime : health check rpc api #5185
Conversation
// Ping implements drivers.Handle. | ||
func (c *Connection) Ping(ctx context.Context) error { | ||
return drivers.ErrNotImplemented | ||
} |
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 we return nil
from these instead when they are not implemented? Returning an error will make it seem like the ping failed (e.g. if we start using the pings elsewhere).
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.
But if we return nil
then it means HealthCheck is implemented and the connection is healthy which in this case is not.
Once we start using these Pings
we should actually implement this.
for k := range c.singleflight { | ||
e := c.entries[k] | ||
if c.opts.OpenTimeout != 0 && e.status == entryStatusOpening && time.Since(e.since) > c.opts.OpenTimeout { | ||
hangingConnErr = fmt.Errorf("a connection has been in opening state for too long") |
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 we also incorporate the connection driver name here like in the other error message?
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 handle
will not be populated if the connection is in entryStatusOpening
state. I could not think of any other way to get the driver name.
Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
No description provided.