ArielGlenn has submitted this change and it was merged. Change subject: increase zmq queue backlog length for salt cli, based on user config ......................................................................
increase zmq queue backlog length for salt cli, based on user config It seems that no one thought that the command line client could also overrun the default ZMQ message queue backlog, but if you have enough minions, and they are fast enough getting back to the master, those events fly right off the event bus faster than the client handles them, and some are dropped. This patch sends LocalClient opts through to get_event() and pulls the pub_hwm setting from those to adust the cli pub socket ZMQ backlog length. This bug does not exist in 2015.8.x because the code has been rewritten to use regular unix sockets without ZMQ. Change-Id: I912022945ec03120691b14bd43703293c93eb725 --- A debian/patches/client_hwm_WMF.patch M debian/patches/series 2 files changed, 49 insertions(+), 0 deletions(-) Approvals: ArielGlenn: Verified; Looks good to me, approved diff --git a/debian/patches/client_hwm_WMF.patch b/debian/patches/client_hwm_WMF.patch new file mode 100644 index 0000000..6509154 --- /dev/null +++ b/debian/patches/client_hwm_WMF.patch @@ -0,0 +1,48 @@ +Description: Use pub_hwm setting for client pub socket +Author: Ariel T. Glenn <[email protected]> +Forwarded: no +--- a/salt/utils/event.py ++++ b/salt/utils/event.py +@@ -108,7 +108,7 @@ + ''' + if transport == 'zeromq': + if node == 'master': +- return MasterEvent(sock_dir or opts.get('sock_dir', None)) ++ return MasterEvent(sock_dir or opts.get('sock_dir', None), opts) + return SaltEvent(node, sock_dir, opts) + elif transport == 'raet': + import salt.utils.raetevent +@@ -221,6 +221,14 @@ + Establish the publish connection + ''' + self.sub = self.context.socket(zmq.SUB) ++ # if 2.1 >= zmq < 3.0, we only have one HWM setting ++ try: ++ self.sub.setsockopt(zmq.HWM, self.opts.get('pub_hwm', 1000)) ++ # in zmq >= 3.0, there are separate send and receive HWM settings ++ except AttributeError: ++ self.sub.setsockopt(zmq.SNDHWM, self.opts.get('pub_hwm', 1000)) ++ self.sub.setsockopt(zmq.RCVHWM, self.opts.get('pub_hwm', 1000)) ++ + self.sub.connect(self.puburi) + self.poller.register(self.sub, zmq.POLLIN) + self.sub.setsockopt(zmq.SUBSCRIBE, '') +@@ -234,6 +242,7 @@ + The linger timeout must be at least as long as this timeout + ''' + self.push = self.context.socket(zmq.PUSH) ++ + try: + # bug in 0MQ default send timeout of -1 (infinite) is not infinite + self.push.setsockopt(zmq.SNDTIMEO, timeout) +@@ -491,8 +500,8 @@ + ''' + Create a master event management object + ''' +- def __init__(self, sock_dir): +- super(MasterEvent, self).__init__('master', sock_dir) ++ def __init__(self, sock_dir, opts=None): ++ super(MasterEvent, self).__init__('master', sock_dir, opts=opts) + + + class LocalClientEvent(MasterEvent): diff --git a/debian/patches/series b/debian/patches/series index 2f6a5f9..fc8e2d0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,3 +8,4 @@ event_reading_returns_prematurely_WMF.patch ping_minions_without_data_cache_WMF.patch singleton_sauth_WMF.patch +client_hwm_WMF.patch -- To view, visit https://gerrit.wikimedia.org/r/261346 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I912022945ec03120691b14bd43703293c93eb725 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/salt Gerrit-Branch: precise Gerrit-Owner: ArielGlenn <[email protected]> Gerrit-Reviewer: ArielGlenn <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
