Hmm, I do have multiple clients -- one per thread.

Jim

On 2/27/12 10:47 AM, "Armon Dadgar" <armon.dad...@gmail.com> wrote:

>Hey Jim,
>
>The PBC client does not share any state between clients,
>but it is not safe to use a single client with multiple threads,
>since the underlying socket will be shared.
>
>If you have multiple threads, just make sure to use multiple
>clients.
>
>Best Regards,
>
>Armon Dadgar
>
>> 
>> Message: 1
>> Date: Sun, 26 Feb 2012 19:39:38 +0000
>> From: Jim Adler <jad...@intelius.com>
>> To: "riak-users@lists.basho.com" <riak-users@lists.basho.com>
>> Subject: Python Client Thread Safe?
>> Message-ID: <cb6fca78.62995%jad...@intelius.com>
>> Content-Type: text/plain; charset="us-ascii"
>> 
>> I'm getting the following error while using protocol buffers
>> (RiakPbcTransport) with more than one thread (stack trace below):
>> 
>>      Socket returned short packet length 0 - expected 4'
>> 
>> I'm using the 1.3.0 Python client on Mac and Ubuntu 11.04 and have seen
>> the same error on both OS's. A single-thread works fine as does the
>> RiakHttpTransport.
>> 
>> Anyone have this problem?
>> 
>> Thanks,
>> Jim
>> 
>> File 
>> 
>>"/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/
>>li
>> b/python2.7/site-packages/riak-1.3.0-py2.7.egg/riak/bucket.py", line
>>260,
>> in get
>>    return obj.reload(r)
>>  File 
>> 
>>"/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/
>>li
>> b/python2.7/site-packages/riak-1.3.0-py2.7.egg/riak/riak_object.py",
>>line
>> 373, in reload
>>    Result = t.get(self, r, vtag)
>>  File 
>> 
>>"/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/
>>li
>> b/python2.7/site-packages/riak-1.3.0-py2.7.egg/riak/transports/pbc.py",
>> line 195, in get
>>    msg_code, resp = self.send_msg(MSG_CODE_GET_REQ, req, None)
>>  File 
>> 
>>"/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/
>>li
>> b/python2.7/site-packages/riak-1.3.0-py2.7.egg/riak/transports/pbc.py",
>> line 387, in send_msg
>>    return self.recv_msg(conn, expect)
>>  File 
>> 
>>"/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/
>>li
>> b/python2.7/site-packages/riak-1.3.0-py2.7.egg/riak/transports/pbc.py",
>> line 413, in recv_msg
>>    self.recv_pkt(conn)
>>  File 
>> 
>>"/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/
>>li
>> b/python2.7/site-packages/riak-1.3.0-py2.7.egg/riak/transports/pbc.py",
>> line 460, in recv_pkt
>>    len(nmsglen))
>> RiakError: 'Socket returned short packet length 0 - expected 4'
>> 
>
>_______________________________________________
>riak-users mailing list
>riak-users@lists.basho.com
>http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to