[ https://issues.apache.org/jira/browse/PROTON-1964?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alan Conway updated PROTON-1964: -------------------------------- 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 - {noformat} [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]$ {noformat} The proactor code coredumps. was: 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. It can be reproduced by editing TEST_CASE("proactor_proton_1586") in c/tests/proactor_tests.cpp, read the comments there. The original 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 - {noformat} [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]$ {noformat} The proactor code coredumps. > [c] pn_proactor_wait() can return empty event batches. > ------------------------------------------------------ > > Key: PROTON-1964 > URL: https://issues.apache.org/jira/browse/PROTON-1964 > Project: Qpid Proton > Issue Type: Bug > Components: proton-c > Reporter: Alan Conway > Assignee: Alan Conway > Priority: Major > Fix For: proton-c-0.18.0 > > > 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 - > {noformat} > [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]$ > {noformat} > The proactor code coredumps. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org