diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-30 19:16:53 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-30 19:16:53 -0400 |
commit | 274839a76c3c15ca12621fedc44f87588295a2d3 (patch) | |
tree | 8d1f95d77c35ec2e80ee816f150e9cdf594e7ace /src | |
parent | 4ac482e01826a01572ebbc735baed9ad81012c4a (diff) | |
parent | 5f423e46d900d93a6a87ad2243124ec7fa894c93 (diff) |
Merge pull request #486 from aboroska/fix-group_leader-dead-pid
Fix badarg exception when setting group_leader for a dead pid
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_shell.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index c80badf..300f6fd 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -107,8 +107,10 @@ setup_shell() -> %% wait until user_drv and user have been registered (max 3 seconds) ok = wait_until_user_started(3000), %% set any process that had a reference to the old user's group leader to the - %% new user process - _ = [erlang:group_leader(whereis(user), Pid) || Pid <- NeedsUpdate], + %% new user process. Catch the race condition when the Pid exited after the + %% liveness check. + _ = [catch erlang:group_leader(whereis(user), Pid) || Pid <- NeedsUpdate, + is_process_alive(Pid)], %% enable error_logger's tty output ok = error_logger:swap_handler(tty), %% disable the simple error_logger (which may have been added multiple |