mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39794 from cachedout/clean_monitor_socket_shutdown
Clean up errors which might be thrown when the monitor socket shuts down
This commit is contained in:
commit
f223fa8906
1 changed files with 9 additions and 3 deletions
|
@ -28,6 +28,7 @@ import salt.transport.mixins.auth
|
|||
from salt.exceptions import SaltReqTimeoutError
|
||||
|
||||
import zmq
|
||||
import zmq.error
|
||||
import zmq.eventloop.ioloop
|
||||
# support pyzmq 13.0.x, TODO: remove once we force people to 14.0.x
|
||||
if not hasattr(zmq.eventloop.ioloop, 'ZMQIOLoop'):
|
||||
|
@ -1006,9 +1007,14 @@ class ZeroMQSocketMonitor(object):
|
|||
|
||||
def start_poll(self):
|
||||
log.trace("Event monitor start!")
|
||||
while self._monitor_socket is not None and self._monitor_socket.poll():
|
||||
msg = self._monitor_socket.recv_multipart()
|
||||
self.monitor_callback(msg)
|
||||
try:
|
||||
while self._monitor_socket is not None and self._monitor_socket.poll():
|
||||
msg = self._monitor_socket.recv_multipart()
|
||||
self.monitor_callback(msg)
|
||||
except (AttributeError, zmq.error.ContextTerminated):
|
||||
# We cannot log here because we'll get an interrupted system call in trying
|
||||
# to flush the logging buffer as we terminate
|
||||
pass
|
||||
|
||||
@property
|
||||
def event_map(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue