-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Reintroduce advisory locking when starting the node #5215
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
3 similar comments
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
2380f69
to
280e67f
Compare
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
280e67f
to
8af2ae4
Compare
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
} | ||
|
||
// Try to immediately acquire an advisory lock. The lock will be released on application stop. | ||
func (app *ChainlinkApplication) AdvisoryLock(ctx context.Context, timeout time.Duration) error { |
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.
Would it be a little cleaner to pass just one of these two params?
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's not quite the same: the context times out the entire operation, but the timeout is for how long before timing out each lock attempt inside the loop.
We're hoping to remove this lock altogether anyway, I had to re-add it because I removed the old implementation in the store and some operators are relying on this to run a fallback node (spin up two nodes, have one keep looping, if primary node dies it takes over)
0f84055
to
e8103fd
Compare
No reason to start a completely separate DB connection just to hold a lock.
e8103fd
to
6a3ebb9
Compare
No description provided.