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

Fix subprocess handling #48

Merged
merged 16 commits into from Mar 7, 2019

Conversation

Projects
None yet
2 participants
@at-wat
Copy link
Member

commented Feb 25, 2019

fix #47
fix #49

@at-wat at-wat self-assigned this Feb 25, 2019

@at-wat at-wat changed the title Retry libypspur initialization Fix subprocess handling Mar 5, 2019

@at-wat at-wat referenced this pull request Mar 5, 2019

Closed

Release 0.3.0 #50

2 of 2 tasks complete
{
std::vector<std::string> args;

This comment has been minimized.

Copy link
@at-wat

at-wat Mar 7, 2019

Author Member

Doing string processing after fork causes a kind of dead lock on strict environments like Alpine.

if (pid_ > 0)
{
ROS_INFO("killing ypspur-coordinator (%d)", (int)pid_);
kill(pid_, SIGINT);

This comment has been minimized.

Copy link
@at-wat

at-wat Mar 7, 2019

Author Member

without wait, child process goes zombie.

@at-wat at-wat requested a review from DaikiMaekawa Mar 7, 2019

@at-wat

This comment has been minimized.

Copy link
Member Author

commented Mar 7, 2019

@DaikiMaekawa please take a look

{
const int err = errno;
ROS_ERROR("failed to fork process: %s", strerror(err));
throw(std::string("failed to fork process"));

This comment has been minimized.

Copy link
@DaikiMaekawa

DaikiMaekawa Mar 7, 2019

Member

Can you define a dedicated exception for these?
std::string could throw an exception during use.

This comment has been minimized.

Copy link
@at-wat

at-wat Mar 7, 2019

Author Member

Many other part has same problem. I will fix them in separate PR. #51

This comment has been minimized.

Copy link
@DaikiMaekawa

DaikiMaekawa Mar 7, 2019

Member

fair enough.

args.push_back(param_file_);
}

char **argv = new char *[args.size() + 1];

This comment has been minimized.

Copy link
@DaikiMaekawa

DaikiMaekawa Mar 7, 2019

Member

Where is it released?

args.push_back(std::string("--admask"));
args.push_back(ad_mask);
args.push_back(std::string("--msq-key"));
args.push_back(std::to_string(key_));

This comment has been minimized.

Copy link
@DaikiMaekawa

DaikiMaekawa Mar 7, 2019

Member

use the initializer list.

@at-wat at-wat referenced this pull request Mar 7, 2019

Open

Refactoring #51

0 of 2 tasks complete
@at-wat

This comment has been minimized.

Copy link
Member Author

commented Mar 7, 2019

@DaikiMaekawa addressed your comments. PTAL

@DaikiMaekawa
Copy link
Member

left a comment

👍 LGTM

@at-wat at-wat merged commit 39db1e5 into master Mar 7, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@at-wat at-wat deleted the retry-libypspur-init branch Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.