Skip to content
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ riak.egg-info/
.eggs/
#*#
*~
*.ps1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Contributors
* Mark Phillips
* Mathias Meyer
* Matt Heitzenroder
* [Matt Lohier](https://github.com/aquam8)
* Mikhail Sobolev
* Reid Draper
* Russell Brown
Expand Down
20 changes: 20 additions & 0 deletions make.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

$env:RIAK_TEST_HOST = 'riak-test'
$env:RIAK_TEST_PROTOCOL = 'pbc'
$env:RIAK_TEST_PB_PORT = 10017
$env:RUN_DATATYPES = 1
$env:RUN_INDEXES = 1
$env:RUN_POOL = 1
$env:RUN_YZ = 1

flake8 --exclude=riak/pb riak commands.py setup.py version.py
if ($LastExitCode -ne 0) {
throw 'flake8 failed!'
}

python setup.py test
if ($LastExitCode -ne 0) {
throw 'python tests failed!'
}
9 changes: 8 additions & 1 deletion riak/transports/tcp/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ def _ssl_handshake(self):
raise SecurityError(e)

def _recv_msg(self):
msgbuf = self._recv_pkt()
try:
msgbuf = self._recv_pkt()
except socket.timeout as e:
# A timeout can leave the socket in an inconsistent state because
# it might still receive the data later and mix up with a
# subsequent request.
# https://github.com/basho/riak-python-client/issues/425
raise BadResource(e)
mv = memoryview(msgbuf)
msg_code, = struct.unpack("B", mv[0:1])
data = mv[1:].tobytes()
Expand Down