-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix ZooKeeper Topology connection locks not being cleaned up correctly #15757
Conversation
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
This PR will unblock the dependencies upgrade Pull Request where this issue has been found (#15743) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15757 +/- ##
==========================================
- Coverage 68.40% 68.39% -0.01%
==========================================
Files 1556 1556
Lines 195418 195422 +4
==========================================
- Hits 133666 133663 -3
- Misses 61752 61759 +7 ☔ View full report in Codecov by Sentry. |
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.
LGTM! Only a few very minor nits/suggestions. Thanks! ❤️
go/vt/topo/zk2topo/lock.go
Outdated
cleanupCtx, cancel := context.WithTimeout(context.Background(), baseTimeout) | ||
defer cancel() | ||
|
||
if err := zs.conn.Delete(cleanupCtx, nodePath, -1); err != nil { | ||
log.Warningf("Failed to close connection :%v", err) |
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.
This error should be changed. It would have been more helpful in understanding the problem if it was:
log.Warningf("Failed to close connection :%v", err) | |
log.Warningf("Failed to cleanup unsuccessful lock path %s: %v", nodePath, err) |
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.
I also think this would be slightly better for line 94:
errToReturn = vterrors.Wrapf(err, "failed to obtain lock: %v", nodePath)
And line 98:
log.Warningf("Failed to obtain lock: %v", err)
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.
Addressed via 2690688
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.
It should be:
log.Warningf("Failed to cleanup unsuccessful lock path %s: %v", nodePath, err)
@frouioui please resolve the feedback and then go ahead and merge this. Nice work! |
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
#15757) Signed-off-by: Florent Poinsard <[email protected]>
#15757) Signed-off-by: Florent Poinsard <[email protected]>
#15757) Signed-off-by: Florent Poinsard <[email protected]>
…ned up correctly (#15757) (#15764) Signed-off-by: Florent Poinsard <[email protected]> Co-authored-by: Florent Poinsard <[email protected]> Co-authored-by: Florent Poinsard <[email protected]>
…ned up correctly (#15757) (#15762) Signed-off-by: Florent Poinsard <[email protected]> Co-authored-by: Florent Poinsard <[email protected]>
…ned up correctly (#15757) (#15763) Signed-off-by: Florent Poinsard <[email protected]> Co-authored-by: Florent Poinsard <[email protected]>
Description
This PR introduces a new context with timeout to do the clean up phase after we have failed to acquire a new lock in zktopo to prevent the issue described in #15756. Refer to the issue for full context on the issue.
This issue exists on all release branches, but is not visible right now as it is hidden by a bug in the version of
golang.org/x/sync
that we depend on. While it is not strictly necessary to backport to all release branches right now, it is recommended that we do so in order to avoid surprises should we need to upgrade the dependency on a release branch for other reasons.Related Issue(s)