Bug 431928

Summary: Clean shutdown of broker.
Product: Red Hat Enterprise MRG Reporter: Alan Conway <aconway>
Component: qpid-cppAssignee: messaging-bugs <messaging-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Kim van der Riet <kim.vdriet>
Severity: high Docs Contact:
Priority: medium    
Version: betaCC: astitcher
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qpidd-0.2-24.el5, qpidc-0.2-24.el5, and rhm-0.2-18.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-29 16:46:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alan Conway 2008-02-07 21:04:43 UTC
Description of problem:

src/qpidd.cpp defines a signal handler to shut down the broker, however
calling Broker::shutdown() directly from the handler is not async-signal safe.

The handler should push a shutdown event into the             
epoll poller (making sure to use only async-safe functions!)             
and let a poller thread actually do the shutdown.   

Requires extension of the Poller to allow polling for non-socket events,
e.g. allow arbitrary file descriptors.

Comment 1 Alan Conway 2008-02-07 21:31:36 UTC
Better solution from astitcher: stopping the poller is async-signal safe, and
causes main() to return so the Broker dtor is called. Move all other shutdown
code (logging, management shutdown) to the broker dtor or to main() after
Broker::run()  

Comment 2 Mike Bonnet 2008-02-29 16:46:55 UTC
Fixed in qpidd-0.2-24.el5, qpidc-0.2-24.el5, and rhm-0.2-18.el5