Exa-Networks / exaproxy

Performant Content Modifying Non-Caching Proxy [stable - accepting patches for bug fixes only]
Other
145 stars 36 forks source link

Broken pipe when when writing to messagebox. #30

Closed readevalprint closed 10 years ago

readevalprint commented 10 years ago

I'm not sure about the fix for this. Perhaps in the case of this specific error we could retry a few times before raising the exception?

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opt/exaproxy/lib/exaproxy/util/debug.py", line 71, in <module>
    execfile(sys.argv[0])
  File "/opt/exaproxy/lib/exaproxy/application.py", line 317, in <module>
    main()
  File "/opt/exaproxy/lib/exaproxy/application.py", line 280, in main
    Supervisor(configuration).run()
  File "/opt/exaproxy/lib/exaproxy/supervisor.py", line 124, in __init__
    redirector = fork_redirector(self.poller, self.configuration)
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/__init__.py", line 38, in fork_redirector
    supervisor.run()
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/supervisor.py", line 120, in run
    status = self.reactor.run()
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/reactor.py", line 66, in run
    self.querier.sendResponse(client_id, command, decision)
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/messagebox.py", line 69, in sendResponse
    return self.box.put(message)
  File "/opt/exaproxy/lib/exaproxy/util/messagebox.py", line 91, in put
    self.pipe_out.write(message_s)
IOError: [Errno 4] Interrupted system call

--------------------------------------------------------------------------------
-- Please provide the information above on :
-- http://code.google.com/p/exaproxy/issues/entry
--------------------------------------------------------------------------------

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/opt/exaproxy/lib/exaproxy/reactor/redirector/dispatch.py", line 16, in run
    self.messagebox.box.put(message)
  File "/opt/exaproxy/lib/exaproxy/util/messagebox.py", line 91, in put
    self.pipe_out.write(message_s)
IOError: [Errno 32] Broken pipe
thomas-mangin commented 10 years ago

Nasty issue to have, as I believe we have no way to know what was written on the pipe (and therefore known where to resume the write). The issue is still on master but the string asks to report this issue on googlecode, so this code must not be the most recent. We are going to dig into it to see how we can handle this (and the possible performance impact to write the message byte per byte).

readevalprint commented 10 years ago

Thanks @thomas-mangin

thomas-mangin commented 10 years ago

Ok - I the error message is confusing as errno 4 is errno.EINTR - which just mean we should retry. Should be cleanly fixed with 65c48d172df6253d8070cdfdf605cee335732725

readevalprint commented 10 years ago

Nice!