Description of problem: qpid-snmpd crashes if qpidd broker is not running, and some information is requested from qpid-snmpd. See attachment for the core dump. [root@lzhaldyb-rhel64i qpidd]# service qpidd start Starting Qpid AMQP daemon: [ OK ] [root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd start Starting qpid-snmpd: [ OK ] [root@lzhaldyb-rhel64i qpidd]# snmpget -v 2c -c public localhost brokerSystemSystemId.0 QPID-MESSAGING-MIB::brokerSystemSystemId.0 = STRING: 074e4fcc--c40-1-48-ae-8-39b-546b36c1bb67 [root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd status qpid-snmpd (pid 14798) is running... [root@lzhaldyb-rhel64i qpidd]# service qpidd stop Stopping Qpid AMQP daemon: [ OK ] [root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd status qpid-snmpd (pid 14798) is running... [root@lzhaldyb-rhel64i qpidd]# snmpget -v 2c -c public localhost brokerSystemSystemId.0 Timeout: No Response from localhost. [root@lzhaldyb-rhel64i qpidd]# service qpid-snmpd status qpid-snmpd dead but subsys locked Version-Release number of selected component (if applicable): qpid-snmpd-1.0.0-11.el6 How reproducible: 100% Steps to Reproduce: 1. service qpidd start 2. service qpid-snmpd start 3. service qpidd stop 4. snmpget -v 2c -c public localhost brokerSystemSystemId.0 Actual results: no response received by snmpget, qpid-snmpd crashes. Expected results: qpid-snmpd does not crash. Additional info:
Created attachment 775233 [details] qpid-snmpd core dump file.
Created attachment 776172 [details] Capture exception cause when broker disconnects
Committed and pushed a fix in version 1.0.0-12 - Captured exception thrown by qmf.query when broker is disconnected - Returned SNMP_ERR_NOACCESS when a request is made and broker is disconnected - Decreased net-snmp cache timeout from 60 seconds to 1 to prevent stale data from being returned when broker is disconnected Note: qpid-snmpd responds differently when a request is made BEFORE the broker connects than it does when a request is made AFTER a broker is disconnected. In both cases, there is no broker connection. But the response to a request is different. Before: The request will timeout After: A "no access" error will be returned While not ideal, the changes needed to make the response the same in both cases would be extensive.
Tested on RHEL6.4 (both i386 and x86_64). This issue has been fixed. In case that qpidd broker is not running, the qpid-snmpd daemon returns an error when snmp-get is received and continues running without a crash. Packages used for testing: python-qpid-0.22-4.el6 python-qpid-qmf-0.22-7.el6 qpid-cpp-client-0.22-8.el6 qpid-cpp-client-devel-0.22-8.el6 qpid-cpp-client-devel-docs-0.22-8.el6 qpid-cpp-client-ssl-0.22-8.el6 qpid-cpp-server-0.22-8.el6 qpid-cpp-server-devel-0.22-8.el6 qpid-cpp-server-ssl-0.22-8.el6 qpid-cpp-server-store-0.22-8.el6 qpid-cpp-server-xml-0.22-8.el6 qpid-java-client-0.22-5.el6 qpid-java-common-0.22-5.el6 qpid-java-example-0.22-5.el6 qpid-jca-0.18-8.el6 qpid-jca-xarecovery-0.18-8.el6 qpid-proton-c-0.4-2.2.el6 qpid-qmf-0.22-7.el6 qpid-snmpd-1.0.0-12.el6 qpid-tools-0.22-3.el6 rh-qpid-cpp-tests-0.22-8.el6 -> VERIFIED