You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When RPCReceiveError is raised there is no information about the address of client that sent malformed message:
class BaseSocket:
...
def recv_from_client(self):
try:
data = self.socket.recv_multipart()
addr = data[0].decode()
except UnicodeDecodeError as e:
raise RPCReceiveError("ZMQ interrupted or corrupted message") from e
except zmqerr.ZMQError as e:
raise RPCError("ZMQ network broken") from e
try:
msg = Message.unserialize(data[1])
except (UnicodeDecodeError, msgerr.ExtraData) as e:
raise RPCReceiveError("ZMQ interrupted or corrupted message") from e
return addr, msg
when UnicodeDecodeError or msgerr.ExtraData is caught we have available addr (or whole data) variable and it could be pass as an RPCReceiveError attribute so that it can be properly handled on higher layers of the code (e.g. implement some kind of retry mechanism or discard if this message is from outside of host pool)
Code to reproduce bug
No response
Traceback, if applicable
No response
More info
This is especially used when server receives any message with different protocol (e.g. any HTTP get sent accidentally on socket port)
The text was updated successfully, but these errors were encountered:
What pyzmq version?
24.0.1
What libzmq version?
4.3.4
Python version (and how it was installed)
3.9.13
OS
Windows/CentOS
What happened?
When RPCReceiveError is raised there is no information about the address of client that sent malformed message:
when UnicodeDecodeError or msgerr.ExtraData is caught we have available addr (or whole data) variable and it could be pass as an RPCReceiveError attribute so that it can be properly handled on higher layers of the code (e.g. implement some kind of retry mechanism or discard if this message is from outside of host pool)
Code to reproduce bug
No response
Traceback, if applicable
No response
More info
This is especially used when server receives any message with different protocol (e.g. any HTTP get sent accidentally on socket port)
The text was updated successfully, but these errors were encountered: