Bug 1130563 - qpid-tools do not handle ^C events which result in long backtraces when tools interrupted
Summary: qpid-tools do not handle ^C events which result in long backtraces when tools...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-tools
Version: Development
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: messaging-bugs
QA Contact: Messaging QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-15 14:33 UTC by Frantisek Reznicek
Modified: 2019-02-08 15:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Frantisek Reznicek 2014-08-15 14:33:30 UTC
Description of problem:

qpid-tools do not handle ^C events which result in long backtraces when tools interrupted.

It would be better if qpid-tools have ^C signal handler which avoids backtraces like this:

case a] qpid-ha
# qpid-ha status --all
^CTraceback (most recent call last):
  File "/usr/bin/qpid-ha", line 222, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/qpid-ha", line 213, in main
    main_except(argv)
  File "/usr/bin/qpid-ha", line 209, in main_except
    command.execute(args)
  File "/usr/bin/qpid-ha", line 105, in execute
    try: self.do_execute(qmf_broker, ha_broker, opts, args)
  File "/usr/bin/qpid-ha", line 154, in do_execute
    connection, qmf_broker, ha_broker = self.connect(opts)
  File "/usr/bin/qpid-ha", line 92, in connect
    connection = Connection.establish(opts.broker, **conn_options)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 68, in establish
    conn.open(timeout=timeout)
  File "<string>", line 6, in open
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 268, in open
    self.attach(timeout=timeout)
  File "<string>", line 6, in attach
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 286, in attach
    if not self._ewait(lambda: self._transport_connected and not self._unlinked(), timeout=timeout):
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 218, in _ewait
    result = self._wait(lambda: self.error or predicate(), timeout)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 197, in _wait
    return self._waiter.wait(predicate, timeout=timeout)
  File "/usr/lib/python2.6/site-packages/qpid/concurrency.py", line 59, in wait
    self.condition.wait(timeout - passed)
  File "/usr/lib/python2.6/site-packages/qpid/concurrency.py", line 96, in wait
    sw.wait(timeout)
  File "/usr/lib/python2.6/site-packages/qpid/compat.py", line 117, in wait
    ready, _, _ = select([self], [], [], timeout)
  File "/usr/lib/python2.6/site-packages/qpid/compat.py", line 80, in select
    active = poller.poll(timeout)
KeyboardInterrupt


case b] qpid-stat
# while true; do qpid-stat -q; done
...
^CTraceback (most recent call last):
  File "/usr/bin/qpid-stat", line 33, in <module>
    from qpidtoollibs import BrokerAgent
  File "/usr/lib/python2.6/site-packages/qpidtoollibs/__init__.py", line 20, in <module>
    from qpidtoollibs.broker import *
  File "/usr/lib/python2.6/site-packages/qpidtoollibs/broker.py", line 426, in <module>
    class Connection(BrokerObject):
  File "/usr/lib/python2.6/site-packages/qpidtoollibs/broker.py", line 426, in Connection
    class Connection(BrokerObject):
KeyboardInterrupt


Version-Release number of selected component (if applicable):
qpid-tools-0.22-14.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. qpid-ha status --all
2. ^C while tools is executing

Actual results:
  Tools do not have SIGINT signal handlers.

Expected results:
  Improve tools to have SIGINT signal handlers.


Additional info:

Comment 1 Frantisek Reznicek 2015-04-02 11:04:59 UTC
Still the case with candidate 3.1 packages ()

[root@dhcp-lab-185 ~]# watch 'clustat;pidof qpidd && qpid-ha status --all'
Could not connect to CMAN: No such file or directory
[root@dhcp-lab-185 ~]# Traceback (most recent call last):
  File "/usr/bin/qpid-ha", line 260, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/qpid-ha", line 251, in main
    main_except(argv)
  File "/usr/bin/qpid-ha", line 247, in main_except
    command.execute(args)
  File "/usr/bin/qpid-ha", line 138, in execute
    try: self.do_execute(qmf_broker, ha_broker, opts, args)
  File "/usr/bin/qpid-ha", line 184, in do_execute
    self.all_brokers(ha_broker, opts, status)
  File "/usr/bin/qpid-ha", line 123, in all_brokers
    connection, qmf_broker, ha_broker = self.connect(opts)
  File "/usr/bin/qpid-ha", line 104, in connect
    connection = Connection.establish(opts.broker, **conn_options)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 68, in establish
    conn.open(timeout=timeout)
  File "<string>", line 6, in open
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 279, in open
    self.attach(timeout=timeout)
  File "<string>", line 6, in attach
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 295, in attach
    self._driver.start()
  File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 381, in start
    self._selector.register(self)
  File "/usr/lib/python2.6/site-packages/qpid/selector.py", line 76, in register
    self.modify(selectable)
  File "/usr/lib/python2.6/site-packages/qpid/selector.py", line 91, in modify
    self.wakeup()
  File "/usr/lib/python2.6/site-packages/qpid/selector.py", line 72, in wakeup
    self.waiter.wakeup()
  File "/usr/lib/python2.6/site-packages/qpid/compat.py", line 118, in wakeup
    self._do_write()
  File "/usr/lib/python2.6/site-packages/qpid/compat.py", line 199, in _do_write
    os.write(self.write_fd, "\0")
KeyboardInterrupt
^C
[root@dhcp-lab-185 ~]# ^C
[root@dhcp-lab-185 ~]# rpm -q qpid-tools
qpid-tools-0.30-5.el6.noarch


Note You need to log in before you can comment on or make changes to this bug.