From: SourceForge.net <no...@so...> - 2010-12-26 15:26:13
|
Feature Requests item #2220356, was opened at 2008-11-04 13:33 Message generated for change (Settings changed) made by avpak You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=532254&aid=2220356&group_id=71730 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: OpenHPI Daemon Group: 2.17.x Status: Open >Resolution: Accepted Priority: 5 Private: No Submitted By: Raghavendra PG (pgraghu) >Assigned to: Anton Pak (avpak) Summary: Supporting the graceful shutdown for openhpi daemon Initial Comment: Currently the openhpi is stopped abruptly and it is not supporting graceful shutdown. Graceful shutdown of the OpenHPI helps in closing the connections with the managed devices (like shelf manager of ATCA, OA of HP c-Class, etc) and releasing all the allocated memory by the openhpi. The most important advantage of the graceful shutdown is that it helps in finding the memory leaks. The attached patch supports the graceful shutdown for OpenHPI and supports close() ABI is complete implementation for simulator plugin. The openhpi shutdown request can be sent through the kill command with SIGUSR1 signal or via init.d/openhpid shell script with shutdown as option. The openhpid shell script sends SIGUSR1 signal to openhpid process. The SIGUSR1 signal can be caught by the signal handler in openhpid daemon. And the shutdown signal can be sent to all the openhpi threads. Please note that 'stop' option in init.d/openhpid shell script (or kill <pid of openhpid> stops the openhpid abruptly. This is not changed as part of this patch. The openhpid.sh.in file has been modified to send the SIGUSR1 signal as part of the shutdown request. BUT, I'm not able to test it for the different Linux OS. I am looking forward for help from the different OS experts. Using this patch, memory leaks in openhpi are detected and the bug #1823713 has been closed. (https://sourceforge.net/tracker/index.php?func=detail&aid=1823713&group_id=71730&atid=532251) The focus of the graceful shutdown is for the daemon to be able to handle a shutdown signal, close client connections, close open handlers, and to release all memory resources. Since the changes involve many parts of the infrastructure, we can discuss the proposed changes. The advantage --------------- * Facilitates use of memory leak detection tools (like valgrind). * Encourages plug-in writers to fully implement close calls * Closes the connection with the managed devices so that managed devices can also cleanup the resources allocated. * Most of the telecom players are very strict on memory leaks. Since, the openhpi may run for few months to few years, the memory leaks in openhpi (if any) may create serious problems. The end-user can test on his/her system for the memory leaks. This helps in increasing the end-user confidence in OpenHPI. The disadvantages ------------------ * Complicates the socket connection a little, because of the use of timeouts * Requires more source code for the shutdown operation, which is really wasted since the kernel is going to dispose of the daemon process resources anyway. The openhpi daemon graceful shutdown and simulator shutdown patches are attached. ---------------------------------------------------------------------- Comment By: Raghavendra PG (pgraghu) Date: 2009-01-25 11:28 Message: Fixed in openhpi SVN revision 6942 ---------------------------------------------------------------------- Comment By: Raghavendra PG (pgraghu) Date: 2008-11-04 13:35 Message: The attached graceful_shutdown_notes gives more information the changes done. File Added: graceful_shutdown_notes.txt ---------------------------------------------------------------------- Comment By: Raghavendra PG (pgraghu) Date: 2008-11-04 13:33 Message: File Added: simulator_graceful_shutdown.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=532254&aid=2220356&group_id=71730 |