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

2i Requests over PBC block forever when 0 results match in 1.4.x #122

Merged
merged 3 commits into from
Sep 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Riak Ruby Client Release Notes

## 1.4.2 Bugfix Release - TBD

Release 1.4.2 fixes a bug.

Bugfix:

* 2i Requests over PBC block forever when 0 results match in 1.4.x,
reported by Sean "graphex" McKibben in
https://github.com/basho/riak-ruby-client/pull/121 and
https://github.com/basho/riak-ruby-client/pull/122

## 1.4.1 Patch/Bugfix Release - 2013-09-06

Release 1.4.1 fixes a few minor bugs and issues.
Expand Down
5 changes: 5 additions & 0 deletions lib/riak/client/beefcake_protobuffs_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ def decode_index_response
code = MESSAGE_CODES[msgcode]
raise SocketError, "Expected IndexResp, got #{code}" unless code == :IndexResp

if msglen == 1
return if block_given?
return IndexCollection.new_from_protobuf(RpbIndexResp.decode(''))
end

message = RpbIndexResp.decode socket.read msglen - 1

if !block_given?
Expand Down
9 changes: 6 additions & 3 deletions spec/riak/beefcake_protobuffs_backend_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,20 @@
results.should == %w{asdf asdg asdh}
end

it "should not crash out when no keys or terms are released" do
it "should not crash out when no keys or terms are returned" do
backend.should_receive(:write_protobuff) do |msg, req|
msg.should == :IndexReq
req[:stream].should_not be
end

response_message = Riak::Client::BeefcakeProtobuffsBackend::
RpbIndexResp.new().encode

header = [response_message.length + 1, 26].pack 'NC'
@socket.should_receive(:read).and_return(header, response_message)
@socket.
should_receive(:read).
with(5).
and_return(header)

results = nil
fetch = proc do
Expand Down