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

bug: Consul lock does not receive signals if lock not acquired #5909

Merged
merged 2 commits into from
Jan 22, 2020
Merged

bug: Consul lock does not receive signals if lock not acquired #5909

merged 2 commits into from
Jan 22, 2020

Conversation

palesiak
Copy link

@palesiak palesiak commented May 30, 2019

Fix for #4439, where consul lock does not receive signal if lock has not been acquired. The struct for cmd in command/lock/lock.go has a shutdownCh channel that is not populated on creation. This passes in that channel so it can receive/handle them

cc @slackpad @preetapan

@hashicorp-cla
Copy link

hashicorp-cla commented May 30, 2019

CLA assistant check
All committers have signed the CLA.

@freddygv
Copy link
Contributor

freddygv commented Oct 4, 2019

Hi @palesiak thanks for the contribution. This solution is a good first step.

The remaining concern to address is that if the shutdown signal is received while executing a blocking query against the API, consul lock won't exit until after that query times out. This will take 15s by default, but could be longer if configured with the -timeout flag.

Let me know if you would like some suggestions regarding how to approach this.

@palesiak
Copy link
Author

palesiak commented Dec 5, 2019

Let me know if you would like some suggestions regarding how to approach this.

@freddygv Yes, please! I would love some suggestions. I apologize for not responding to this ticket for so long, as I've been heavily loaded with my day job.

Copy link
Contributor

@freddygv freddygv left a comment

Choose a reason for hiding this comment

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

Hi @palesiak after revisiting this, I don't think that we need to handle the case of aborting during a blocking query.

Going to merge your changes as they are. Thanks again for submitting the PR.

@freddygv freddygv changed the title fix: Consul lock does not receive signals if lock not acquired bug: Consul lock does not receive signals if lock not acquired Jan 22, 2020
@freddygv freddygv merged commit 527daba into hashicorp:master Jan 22, 2020
@palesiak palesiak deleted the pl/lock_signal branch June 15, 2020 19:18
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.

None yet

3 participants