Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

roslaunch: ensure pid file is removed on exit#1057

Merged
dirk-thomas merged 1 commit intoros:lunar-develfrom
furushchev:ensure-remove-pid
May 24, 2017
Merged

roslaunch: ensure pid file is removed on exit#1057
dirk-thomas merged 1 commit intoros:lunar-develfrom
furushchev:ensure-remove-pid

Conversation

@furushchev
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@dirk-thomas Done!

@dirk-thomas
Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants