The Unix python client can erroneously throw exceptions from select due to 
interrupted system call
--------------------------------------------------------------------------------------------------

                 Key: QPID-2294
                 URL: https://issues.apache.org/jira/browse/QPID-2294
             Project: Qpid
          Issue Type: Bug
          Components: Python Client
    Affects Versions: 0.6
         Environment: Red Hat Enterprise Linux 5.4
            Reporter: Andrew Stitcher
            Assignee: Rafael H. Schloming


When running autotools "make check"

You can cause the python_tests to fail in the qpid.tests.messaging section (and 
perhaps elsewhere) by resizing the window that is running the tests.

You get something like this:
qpid.tests.messaging.SenderTests.testSendAsyncCapacityUNLIMITED 
............................ fail
Error during test:
  Traceback (most recent call last):
    File 
"/home/astitche/bld-working/src/tests/python/commands/qpid-python-test", line 
307, in run
      phase()
    File "/home/astitche/bld-working/src/tests/python/qpid/tests/messaging.py", 
line 796, in testSendAsyncCapacityUNLIMITED
      self.asyncTest(UNLIMITED)
    File "/home/astitche/bld-working/src/tests/python/qpid/tests/messaging.py", 
line 777, in asyncTest
      drained = self.drain(self.rcv, timeout=self.delay())
    File "/home/astitche/bld-working/src/tests/python/qpid/tests/messaging.py", 
line 84, in drain
      contents.append(rcv.fetch(timeout=timeout).content)
    File "<string>", line 6, in fetch
    File "/home/astitche/bld-working/src/tests/python/qpid/messaging.py", line 
668, in fetch
      msg = self.session._get(self._pred, timeout=timeout)
    File "<string>", line 6, in _get
    File "/home/astitche/bld-working/src/tests/python/qpid/messaging.py", line 
360, in _get
      timeout):
    File "/home/astitche/bld-working/src/tests/python/qpid/messaging.py", line 
294, in _ewait
      result = self.connection._ewait(lambda: self.error or predicate(), 
timeout, exc)
    File "/home/astitche/bld-working/src/tests/python/qpid/messaging.py", line 
142, in _ewait
      result = self._wait(lambda: self.error or predicate(), timeout)
    File "/home/astitche/bld-working/src/tests/python/qpid/messaging.py", line 
131, in _wait
      return self._waiter.wait(predicate, timeout=timeout)
    File "/home/astitche/bld-working/src/tests/python/qpid/concurrency.py", 
line 59, in wait
      self.condition.wait(timeout - passed)
    File "/home/astitche/bld-working/src/tests/python/qpid/concurrency.py", 
line 96, in wait
      sw.wait(timeout)
    File "/home/astitche/bld-working/src/tests/python/qpid/compat.py", line 53, 
in wait
      ready, _, _ = select([self], [], [], timeout)
  error: (4, 'Interrupted system call')


The cause is that python is receiving the SIGWINCH signal from the window size 
change and this is interrupting the select system call. The exception that is 
being thrown by select is not being caught.

This needs to be fixed as interrupted system calls are a fact of life when 
running on Unix - you could argue that the python run time should just restart 
the select, but it isn't doing that here.

Note that allowing for interrupted system calls screws up the timeout 
calculation. As you'll need to figure out how much of the wait is left and then 
wait for less time when restarting the system call.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to