From a14db7647e927a50a1e6d4b08488ac30ddfdaec9 Mon Sep 17 00:00:00 2001 From: James Darren Muir Date: Thu, 14 Dec 2023 16:38:02 -0800 Subject: [PATCH] properly shutdown xml rpc server stop CPU usage spike when a rospy node receives a signals.SIGINT interrupt but before it terminates the process (e.g. pressing CTRL+C while the node is sleeping due to a rospy.sleep() call no longer sends CPU usage of a core to 100%) should also fix https://github.com/ros/ros_comm/issues/2238 --- tools/rosgraph/src/rosgraph/xmlrpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rosgraph/src/rosgraph/xmlrpc.py b/tools/rosgraph/src/rosgraph/xmlrpc.py index 4d1de93d9a..fcb6ca4af0 100644 --- a/tools/rosgraph/src/rosgraph/xmlrpc.py +++ b/tools/rosgraph/src/rosgraph/xmlrpc.py @@ -229,8 +229,8 @@ def shutdown(self, reason): if handler: handler._shutdown(reason) if server: - server.socket.close() server.server_close() + server.shutdown() def start(self): """