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

roslaunch: ensure pid file is removed on exit #1057

Merged
merged 1 commit into from
May 24, 2017

Conversation

furushchev
Copy link
Contributor

If --pid option is set, pid file is written at https://github.com/ros/ros_comm/blob/lunar-devel/tools/roslaunch/src/roslaunch/__init__.py#L257 but codes for removing written pid file is under if-else condition (so there can be conditions that roslaunch process dies but pid file is left without removal)
This pull request moves the code for pid file removal to main try-except-finally block so to ensure pid file is removed if exists.

@furushchev furushchev changed the title ensure pid file is removed on exit roslaunch: ensure pid file is removed on exit May 18, 2017
@furushchev furushchev force-pushed the ensure-remove-pid branch 2 times, most recently from 68d9c9f to 7436467 Compare May 18, 2017 04:10
Copy link
Member

@dirk-thomas dirk-thomas left a comment

Choose a reason for hiding this comment

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

Please edit the PR to target the latest development branch lunar-devel.

try: os.unlink(options.pid_fn)
except os.error: pass
except:
pass
Copy link
Member

Choose a reason for hiding this comment

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

Why should this catch and ignore arbitrary exceptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dirk-thomas Thank you for review! I have no reason. Removed try.

@dirk-thomas
Copy link
Member

The patch looks good now. Can you please still edit the PR to target the latest development branch lunar-devel ("edit" button right beside the issue title).

@furushchev furushchev changed the base branch from indigo-devel to lunar-devel May 22, 2017 23:07
@furushchev
Copy link
Contributor Author

furushchev commented May 22, 2017

@dirk-thomas Changed base branch to lunar-devel, but it seems to be many conflicts. Is it still ok, or should I cherry-pick to lunar-devel?

@dirk-thomas
Copy link
Member

You will need to rebase your patch to the new target branch.

@furushchev furushchev force-pushed the ensure-remove-pid branch from 0968d97 to d469733 Compare May 23, 2017 01:14
@furushchev
Copy link
Contributor Author

@dirk-thomas Done!

@dirk-thomas
Copy link
Member

Thank you!

@dirk-thomas dirk-thomas merged commit 0199c93 into ros:lunar-devel May 24, 2017
@furushchev furushchev deleted the ensure-remove-pid branch May 25, 2017 00:21
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.

2 participants