Skip to content

Commit

Permalink
Fix #62092: Catch zmq.error.ZMQError to set HWM for zmq >= 3
Browse files Browse the repository at this point in the history
It looks like before release 23.0.0, when trying to access zmq.HWM it
was raising ``AttributeError``, which is now wrapped under pyzmq's own
``zmq.error.ZMQError``.
Simply caching that, should then set the HWM correctly for zmq >= 3
and therefore fix #62092.
  • Loading branch information
mirceaulinic authored and Megan Wilhite committed Jun 1, 2022
1 parent 01b3dce commit 6ec8b90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion salt/transport/zeromq.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def publish_daemon(
try:
pub_sock.setsockopt(zmq.HWM, self.opts.get("pub_hwm", 1000))
# in zmq >= 3.0, there are separate send and receive HWM settings
except AttributeError:
except (AttributeError, zmq.error.ZMQError):
# Set the High Water Marks. For more information on HWM, see:
# http://api.zeromq.org/4-1:zmq-setsockopt
pub_sock.setsockopt(zmq.SNDHWM, self.opts.get("pub_hwm", 1000))
Expand Down

0 comments on commit 6ec8b90

Please sign in to comment.