Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1964

[c] pn_proactor_wait() can return empty event batches.

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: proton-c-0.18.0
    • Component/s: proton-c
    • Labels:
      None

      Description

      The bug PROTON-1586  had events returned after a connection was TRANSPORT_CLOSED and no longer existed (original reproducer below) The bug still exists in a more subtle form - the proactor can return an empty event batch after TRANSPORT_CLOSED. This does not cause segfaults but is incorrect behavior according to the proactor documentation.

      To reproduce the problem see the comments in c/tests/pn_test_proactor.cpp in function proactor::wait_next().

      The fix to PROTON-1586 was to have the connection_driver batch to hide events after TRANSPORT_CLOSE by returning NULL as if the batch were empty. However, that is too late to prevent the batch being returned by the proactor - from the proactors perspective it is not empty, it contains  CONNECTION_LOCAL_CLOSE but it looks empty to the user.

      This is really a bug in the pn_connection_driver, not the proactor, and it should be fixed there so that all proactors and non-proactor applications will benefit.


      Original reproducer: 

      Run the send examples code with an invalid hostname like shown in the following -

      [gmurthy@localhost build]$ pwd
      /home/gmurthy/opensource/qpid-proton/build
      [gmurthy@localhost build]$ 
      [gmurthy@localhost build]$ 
      [gmurthy@localhost build]$ examples/c/send nosuchhost
      PN_TRANSPORT_CLOSED: proton:io: No address associated with hostname - connect to  nosuchhost:5672
      epoll proactor failure in /home/gmurthy/opensource/qpid-proton/proton-c/src/proactor/epoll.c:648: "arming polled file descriptor": No such file or directory
      Aborted (core dumped)
      [gmurthy@localhost build]$ 
      

      The proactor code coredumps.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                aconway Alan Conway
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: