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
can now disconnect from cassandra in clients and clusters #18
Conversation
Can one of the admins verify this patch? |
Build with travis.
…oses only for client disconnect
done On 7/11/13 7:11 PM, cyli wrote:
|
|
||
def disconnect(self): | ||
""" | ||
Disconnect every client from the cassandra cluster. Likely to be used for testing |
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.
Thanks for the quick response! The testing comment here can probably also be removed.
So, sorry if I'm being annoying and bikeshedding, but I was thinking that it would be most clear to have the doc comments say "Cassandara and Silverberg don't require you to close the connection before exiting, but you might want to for cases of testing, constrained resources, etc" instead of "mostly used for testing" or nothing at all. Yeah, I'm bikeshedding. Sorry. :( |
@cyli and @wirehead - I think I've been pretty accommodating so far. However, if your comments take longer to write then it would take to just make the change yourself - the message you send is that you're more interested in pedantry than getting stuff done. You're killing my desire to contribute with a thousand paper cuts of trivial requests. Just make the little changes yourself and accept the PR already. |
@bmuller Indeed, thank you again for your generous contributions and your prompt responses! I apologize about my confusion about the use of disconnect, which resulted in an extra change for you. I should have first double-checked with @wirehead first before making the comment, as I did not have a good grasp of how silverberg cleans up connections. I have also been remiss in not further elaborating on our coding and testing standards in the docs, but in general we try to aim for 100% test coverage of changes made in every code request, and not just as documented by the coverage tool (which is a good baseline but does not say anything about the quality of the tests or correctness of behavior the tests are verifying). When the disconnect function was moved, its test was no longer valid where it was. If the disconnect function had been moved back, tests would still pass, therefore the new functionality (that the If you would like this change made, I can certainly make the requisite updates your contributions so far to comply with our general process. The best way would probably be for me to pull your changes into my own fork that I have push access to, make the test and comment changes, and submit a new request. Would that be satisfactory to you? |
@cyli feel free to make any changes to any of my PR's at any point to fix whatever issues may prevent acceptance. My only goal is to get the fixes/features incorporated into master - and I don't care at all even if those changes are squashed into one of your commits. |
@bmuller Thank you for your understanding and flexibility - that will make my life a lot easier than experimenting with how to fork a fork and then make a pull request back to the original. :) |
Sure - no worries. |
…method from TestCQLClient to CQLClient and add a disconnect method and tests to cluster.
@bmuller Created a new pull request with the requisite changes, and will merge once it passes review. Closing this PR. |
Excellent - thanks so much! |
@bmuller The changes have been merged in! Thanks again for your patience. |
No problem - thanks for merging. In the future - feel free to mangle/squash/manipulate/recreate/etc any of my PR's to get them merged (especially if there are only minor changes/edits necessary). If there's anything major - like bugs, structure issues, etc - that would/should require major changes on my part - then I can definitely handle those myself. Thanks so much! |
When testing other libs that use silverberg, it's essential that connections can be closed so that the reactor is left in a clean state after each test run. I moved the disconnect method to the main CQLClient class and added a disconnect method to the round robin cluster as well.
Wrote new test case. Lint / tests pass.