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

Add lease recipe. #176

Merged
merged 1 commit into from Mar 21, 2015
Merged

Add lease recipe. #176

merged 1 commit into from Mar 21, 2015

Conversation

lallea
Copy link

@lallea lallea commented Mar 12, 2014

This is in production at Spotify for monitoring scripts.

@bbangert
Copy link
Member

This commit looks perfectly fine, though I'm wary of adding more recipes to the core that the Kazoo maintainers don't have time to support (having recipes in kazoo gives people the impression we'll maintain them and handle bugs, per #175 which refers to a bug in a recipe that we merged).

Also see #136 as it was decided not to include that. At the same time it would be sad if others were not able to benefit from this as its a very nice contribution. Rather than having a contrib/ type thing with 'unsupported' recipes, would one or two folks behind this PR be interested in being the owner for this recipe? (I'm mainly envisioning someone that could review changes/bugs reported solely in this recipe).

@lallea
Copy link
Author

lallea commented Mar 12, 2014

I'm happy to volunteer as maintainer for this file. Let me know if you want me to find another for redundancy.

It is ironic that you mentioned #136, as I was recently looking for a queue that removes duplicates, for job scheduling purposes. If it had been in kazoo, I would have found it and used it, maintained or not. The kazoo brand helps users find the implementations. If I put up a personal repository with my own recipes, they will go unnoticed. One could of course envision alternatives for using the brand value, such as a kazoo contrib page with links to third party recipes.

@bbangert
Copy link
Member

Agreed, I think having 'owners' for recipes that land would help, as well as maybe some meta information in the module docs indicating the recipe's status, who the owner is, and if an owner decides to not maintain it then that could be indicated (no owner).

@bbangert
Copy link
Member

I'm going to update the existing recipe's with maintenance/owner info so you can see the layout, and update the PR, then I'll be happy to merge it. Thanks for volunteering this and to own it!

@lallea
Copy link
Author

lallea commented Mar 13, 2014

SGTM. Let me know when you have done so, and I'll update the PR.

Thanks!

On Wed, Mar 12, 2014 at 8:52 PM, Ben Bangert notifications@github.comwrote:

I'm going to update the existing recipe's with maintenance/owner info so
you can see the layout, and update the PR, then I'll be happy to merge it.
Thanks for volunteering this and to own it!

Reply to this email directly or view it on GitHubhttps://github.com//pull/176#issuecomment-37455815
.

@bbangert
Copy link
Member

I've added maintainer data for the recipes I'm aware of. You can update this to indicate the maintainer and your comfort level with its status (production, beta, alpha, etc).

@lallea
Copy link
Author

lallea commented Apr 23, 2014

Great, thanks!

I added the maintainer information. I put the status as beta, even though the code is in production, since it is used on a non-critical path, and hasn't received much field testing yet.

I'll check if a colleague wants to be co-maintainer as well.

@bbangert
Copy link
Member

Also, looks like you're missing a doc/ page and entry for it so the docs can be built.

@lallea
Copy link
Author

lallea commented May 27, 2014

Sorry for dropping this for so long.

I pushed a doc entry, and the docs seem to build fine and look reasonable. I also read the (updated?) contribution instructions more carefully and added an entry in CHANGES.

Travis reports a test error, but in a test that does not touch the recipe, and seems to be unrelated. If you prefer not to merge due to failures, I'll babysit and see if the build returns to green.

lock = client.Lock(path, ident)
try:
with lock:
now = utcnow()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anyway to avoid using localtime (local to the client) here in a client and use the zookeeper node's time instead? Maybe just put a delta (or duration) in the znode and then use the znodes times? Just a suggestion that would avoid later timing issues.

Copy link
Author

Choose a reason for hiding this comment

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

I think you have a valid theoretical point, but I'm not sure it is practical. IIUC, the advantage of using zk node time would be to handle scenarios when client clocks are widely out of sync. It is rare these days, since machines typically have NTP enabled by default, and if you are out of sync by minutes, you usually have worse trouble anyway. :-)

The disadvantages would be more complex code, and complex testing. I cannot think of an efficient way to test such a setup. Does zk provide remote controlled mock clock behaviour? Even if it does, it would become quite messy.

I should document the assumption that clocks are in sync, though. Will do.

Copy link
Author

Choose a reason for hiding this comment

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

Docs now updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks.

@bbangert
Copy link
Member

r+, just needs a rebase to land

@bbangert
Copy link
Member

@lallea ping, this looks good, just need a rebase for merging.

@lallea
Copy link
Author

lallea commented Mar 21, 2015

Thanks for the ping. Now rebased, tests pass.

bbangert added a commit that referenced this pull request Mar 21, 2015
@bbangert bbangert merged commit 7c8ae11 into python-zk:master Mar 21, 2015
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