Skip to content

Commit

Permalink
Merge branch '64-fix-bug-that-fills-up-the-logs' into 'master'
Browse files Browse the repository at this point in the history
Resolve "Fix bug that fills up the logs"

Closes #64

See merge request open/stapled!49
  • Loading branch information
Maarten de Waard committed Sep 24, 2019
2 parents 7fac046 + 6436784 commit 844c0c8
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions stapled/core/stapleadder.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,29 +245,11 @@ def send(self, paths, command):
http://haproxy.tech-notes.net/9-2-unix-socket-commands/
"""
# Empty buffer first, it's possible that other commands have been fired
# to the same socket, we don't want the response to those commands in
# our response string.
# FIXME: This would be nice, but is tricky because the socket seems to
# close if the recv call times out. Otherwise the socket stays open but
# the recv call is blocking...
# If this problem occurs, the easiest way is probably to open a socket
# each time we want to communicate...
# while True:
# try:
# chunk = self.socks[path].recv(SOCKET_BUFFER_SIZE)
# if not chunk:
# break
# except IOError as err:
# if err.errno not in (errno.EAGAIN, errno.EINTR):
# raise
# else:
# break
responses = []
if not isinstance(paths, (list, tuple)):
paths = [paths]
for path in paths:
with stapled_except_handle():
with stapled_except_handle():
if not isinstance(paths, (list, tuple)):
paths = [paths]
for path in paths:
try:
sock = self.socks[path]
response = self._send(sock, "{}\n".format(command))
Expand Down

0 comments on commit 844c0c8

Please sign in to comment.