You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Gordon Sim (JIRA)" <ji...@apache.org> on 2014/01/15 19:43:20 UTC

[jira] [Resolved] (QPID-2294) The Unix python client can erroneously throw exceptions from select due to interrupted system call

     [ https://issues.apache.org/jira/browse/QPID-2294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim resolved QPID-2294.
------------------------------

       Resolution: Fixed
    Fix Version/s: 0.27

> 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
>             Fix For: 0.27
>
>
> 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 was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org