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

Introduce forceKill logic #11

Merged
merged 3 commits into from
Apr 5, 2021
Merged

Introduce forceKill logic #11

merged 3 commits into from
Apr 5, 2021

Conversation

khous
Copy link
Contributor

@khous khous commented Apr 2, 2021

No description provided.

@khous
Copy link
Contributor Author

khous commented Apr 2, 2021

TODO - add a section in the readme with an example and description of the behavior

@khous khous merged commit bb8f1f0 into main Apr 5, 2021
defer c.mu.Unlock()
err := c.conn.Close()

if err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

There can be valid reasons an error is returned. For example, if the underlying driver already closed the connection. I think here we just log the error (if any) and mark as "killed" no matter what.

defer cg.mu.Unlock()

if v, ok := vs[forceKill]; ok {
firstValue := v[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

This code works fine for the positive case. If someone mistypes the camelCase, they don't get confirmation that their "settings" were bad, however.

@daniel-garcia daniel-garcia deleted the khous/force-kill branch April 7, 2021 15:11
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.

3 participants