Qpid
  1. Qpid
  2. QPID-4147

python-qpid client does not handle interrupts on its selector

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.19
    • Component/s: Python Client
    • Labels:
      None

      Description

      Description of problem:
      python-qpid does not recover if its select() call within the Selector class has been interrupted. This is a problem when setuid() is called after a connection object has been created (hence a new thread has been created).

      Version-Release number of selected component (if applicable):
      python-qpid-0.14
      python-qpid-0.12

      How reproducible:
      Always.

      Steps to Reproduce:
      1. Create a queue called justin
      2. Run the following program:

      #!/usr/bin/python
      import os, sys, time
      from qpid.messaging import Connection
      from qpid.messaging import Message

      addressdefault = 'localhost:5672'

      if len(sys.argv) != 2:
      host = addressdefault
      else:
      host = sys.argv[1]

      def do_message():
      conn = Connection(host)
      conn.open()
      sess = conn.session()
      sender = sess.sender('justin')

      message = Message(content='hello world!')
      sender.send(message)

      do_message()

      try:
      os.setuid(500)
      except:
      print "Exception has happened"
      pass

      do_message()

      Actual results:

      Traceback:

      Exception in thread Thread-1:
      Traceback (most recent call last):
      File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
      self.run()
      File "/usr/lib64/python2.4/threading.py", line 422, in run
      self._target(*self.args, **self._kwargs)
      File "/usr/lib/python2.4/site-packages/qpid/selector.py", line 119, in run
      rd, wr, ex = select(self.reading, self.writing, (), timeout)
      error: (4, 'Interrupted system call')

      Expected results:

      No traceback.

      1. qpid-selector.patch
        1.0 kB
        Siddhesh Poyarekar

        Activity

        Siddhesh Poyarekar created issue -
        Hide
        Siddhesh Poyarekar added a comment -

        Restart the select() call if it was interrupted with an EINTR.

        Show
        Siddhesh Poyarekar added a comment - Restart the select() call if it was interrupted with an EINTR.
        Siddhesh Poyarekar made changes -
        Field Original Value New Value
        Attachment qpid-selector.patch [ 12537005 ]
        Hide
        Rafael H. Schloming added a comment -

        I submitted a fix based on the supplied patch.

        Show
        Rafael H. Schloming added a comment - I submitted a fix based on the supplied patch.
        Rafael H. Schloming made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Rafael H. Schloming [ rhs ]
        Fix Version/s 0.19 [ 12322452 ]
        Resolution Fixed [ 1 ]
        Justin Ross made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        12d 7h 43m 1 Rafael H. Schloming 31/Jul/12 00:06
        Resolved Resolved Closed Closed
        363d 19h 45m 1 Justin Ross 29/Jul/13 19:52

          People

          • Assignee:
            Rafael H. Schloming
            Reporter:
            Siddhesh Poyarekar
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development