Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shutdown rospy timers cleanly #690

Closed
wants to merge 1 commit into from
Closed

Shutdown rospy timers cleanly #690

wants to merge 1 commit into from

Conversation

stonier
Copy link
Contributor

@stonier stonier commented Oct 26, 2015

Timers go off and start periodically running in the background, and will throw exceptions when ros shutdown occurs because of the sleep function.

These are impossible to catch as they're off in a background thread and can be cleanly handled as in the code change.

Others with the same problem:

@stonier
Copy link
Contributor Author

stonier commented Oct 26, 2015

Note - to reproduce, these exceptions are only getting thrown in the simulation branch of that sleep function. I am getting them when simulating with gazebo.

@ros-pull-request-builder
Copy link
Member

Test passed.
Refer to this link for build results: http://jenkins.ros.org/job/_pull_request-indigo-ros_comm/426/

except rospy.exceptions.ROSInterruptException as e:
if rospy.core.is_shutdown():
break
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the else line since it is not necessary.

Timers go off and start periodically running in the background, and will throw exceptions when ros shutdown occurs because of the sleep function.

These are impossible to catch as they're off in a background thread and can be cleanly handled as in the code change.

Others with the same problem:

* [baxter examples](RethinkRobotics/baxter_examples#48)
@ros-pull-request-builder
Copy link
Member

Test failed.
Refer to this link for build results: http://jenkins.ros.org/job/_pull_request-indigo-ros_comm/430/

@ros-pull-request-builder
Copy link
Member

Test passed.
Refer to this link for build results: http://jenkins.ros.org/job/_pull_request-indigo-ros_comm/429/

@stonier
Copy link
Contributor Author

stonier commented Nov 4, 2015

Failed because of the rebase?

r.sleep()
except rospy.exceptions.ROSInterruptException as e:
if rospy.core.is_shutdown():
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the update there was a raise line in here. My previous comment only referred to the else line. I think the raise still needs to stay otherwise this function changes behavior significantly.

@dirk-thomas
Copy link
Member

Thanks for the patch.

Cherry-picked with my previous comment: 2e84880

@dirk-thomas dirk-thomas closed this Nov 9, 2015
@stonier
Copy link
Contributor Author

stonier commented Nov 10, 2015

Faster than I was....thanks :neckbeard:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants