-
Notifications
You must be signed in to change notification settings - Fork 75
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
Harden against connection and server failures #50
Merged
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c6f54ed
Initial torture tests for the zookeeper client
eric 9976a66
Fix duplicates script
eric a0f12f8
Update to zookeeper library 3.4.5 and other fixes
eric 7887c03
Fix bug in apache zookeeper library
eric 564d9bd
Provide connected_host method on the C client
eric 5078201
Provide a way to set the receive timeout on a connection
eric 8a2ff43
Ensure continuations cannot be queued when a session is expired
eric ae534fd
Only submit queued commands when connected
eric 05f2b90
Turn down debugging in in zoomonkey
eric 910a9ae
Turn debugging back on when you're debugging
eric d0586c4
Updating logging for zoomonkey
eric 86d92af
Disable debugging by default
eric 19b6b61
Leave protection to the caller
eric 298231b
Remove extra patch
eric e0c1a9d
Fix condition when closing
eric b008897
Remove old 3.3.5 zkc tar
eric ad7da72
Upgrade java zookeeper gem
eric 28a8799
Trying to get java to work
eric e3caf70
Merge branch 'master' into zoomonkey
eric 469396c
updating zk-server
eric edef71f
Rolling back the zookeeper jar version
eric 4f475f9
Don't enable ZK_DEV automatically
eric 5efb99e
Fix dependency order
eric e7f154d
Fix Makefile reference
eric c256a50
Improving build scripts
eric 2088dda
Updating wrappers
eric d7400f4
Work with any function that doesn't have an argument
eric 9900a11
Update generated wrappers
eric 5e7bc76
Added CHANGELOG entry
eric f4dfdc5
Add a comment about the java library
eric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
source :rubygems | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ end | |
|
||
task :build do | ||
cd 'ext' do | ||
ENV['ZK_DEV'] = 'true' | ||
sh "rake" | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff -ur zkc-3.4.5-orig/c/src/zookeeper.c zkc-3.4.5/c/src/zookeeper.c | ||
--- zkc-3.4.5-orig/c/src/zookeeper.c 2012-09-30 10:53:32.000000000 -0700 | ||
+++ zkc-3.4.5/c/src/zookeeper.c 2013-09-07 21:25:24.000000000 -0700 | ||
@@ -1650,14 +1650,16 @@ | ||
// a PING | ||
if (zh->state==ZOO_CONNECTED_STATE) { | ||
send_to = zh->recv_timeout/3 - idle_send; | ||
- if (send_to <= 0 && zh->sent_requests.head==0) { | ||
-// LOG_DEBUG(("Sending PING to %s (exceeded idle by %dms)", | ||
-// format_current_endpoint_info(zh),-send_to)); | ||
- int rc=send_ping(zh); | ||
- if (rc < 0){ | ||
- LOG_ERROR(("failed to send PING request (zk retcode=%d)",rc)); | ||
- return api_epilog(zh,rc); | ||
- } | ||
+ if (send_to <= 0) { | ||
+ if (zh->sent_requests.head==0) { | ||
+ LOG_DEBUG(("Sending PING to %s (exceeded idle by %dms)", | ||
+ format_current_endpoint_info(zh),-send_to)); | ||
+ int rc=send_ping(zh); | ||
+ if (rc < 0){ | ||
+ LOG_ERROR(("failed to send PING request (zk retcode=%d)",rc)); | ||
+ return api_epilog(zh,rc); | ||
+ } | ||
+ } | ||
send_to = zh->recv_timeout/3; | ||
} | ||
} | ||
@@ -1669,6 +1671,12 @@ | ||
zh->next_deadline.tv_sec += zh->next_deadline.tv_usec / 1000000; | ||
zh->next_deadline.tv_usec = zh->next_deadline.tv_usec % 1000000; | ||
} | ||
+ | ||
+ if (tv->tv_sec == 0 && tv->tv_usec == 0) { | ||
+ LOG_DEBUG(("Returning a 0.0 timeval: state=%d idle_recv=%d idle_send=%d recv_to=%d send_to=%d send_requests=%s", | ||
+ zh->state, idle_recv, idle_send, recv_to, send_to, zh->sent_requests.head==0 ? "false" : "true")); | ||
+ } | ||
+ | ||
*interest = ZOOKEEPER_READ; | ||
/* we are interested in a write if we are connected and have something | ||
* to send, or we are waiting for a connect to finish. */ |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
yeah?
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.
If you're building via the rake task, why not leave around the source to zkc?