SHIMOZAKI, Moriaki created AVRO-1639: ----------------------------------------
Summary: python IPC request causes an exception if the client happens to use the same protocol and port again Key: AVRO-1639 URL: https://issues.apache.org/jira/browse/AVRO-1639 Project: Avro Issue Type: Bug Components: python Affects Versions: 1.7.7 Environment: Client: python avro 1.7.7 Server: Java avro 1.7.7 Reporter: SHIMOZAKI, Moriaki IPC request causes the exception below if the client happens to use the same protocol and port again. {quote} 2015-02-13 22:08:17 - [ERROR] - <type 'exceptions.AttributeError'> 2015-02-13 22:08:17 - [ERROR] - Traceback (most recent call last): File "/home/spyder/work/spyderZkAgent/camera/server/_init_.py", line 69, in _request result = requestor.request(command, param) File "/usr/local/lib/python2.7/dist-packages/avro/ipc.py", line 145, in request return self.issue_request(call_request, message_name, request_datum) File "/usr/local/lib/python2.7/dist-packages/avro/ipc.py", line 262, in issue_request return self.read_call_response(message_name, buffer_decoder) File "/usr/local/lib/python2.7/dist-packages/avro/ipc.py", line 225, in read_call_response remote_message_schema = self.remote_protocol.messages.get(message_name) AttributeError: 'NoneType' object has no attribute 'messages' {quote} What's happening in my environment is as follows: 1. In BaseRequestor.write_handshake_request, remote_hash gets something other than None, and self.remote_protocol is not updated 2. In BaseRequestor.read_handshake_response, the server returns 'BOTH' for 'match' response. This still doesn't update self.remote_protocol. 3. BaseRequestor.read_call_response accesses self.remote_protocol.messages but self.remote_protocol is None. I am avoiding this issue by applying the patch below to my system. {quote} diff -u avro/ipc.py avro.patched/ipc.py --- avro/ipc.py 2015-02-16 10:54:04.000000000 +0900 +++ avro.patched/ipc.py 2015-02-16 10:58:21.000000000 +0900 @@ -151,6 +151,8 @@ if remote_hash is None: remote_hash = local_hash self.remote_protocol = self.local_protocol + else: + self.remote_protocol = REMOTE_PROTOCOLS.get(remote_name) request_datum = {} request_datum['clientHash'] = local_hash request_datum['serverHash'] = remote_hash {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)