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/link ospids to wrek vert #21

Merged
merged 4 commits into from
Jan 17, 2019
Merged

Fix/link ospids to wrek vert #21

merged 4 commits into from
Jan 17, 2019

Conversation

rkallos
Copy link
Owner

@rkallos rkallos commented Jan 16, 2019

No description provided.

This commit makes wrek_vert call exec:run_link instead of a callback
process. Since wrek_vert traps exits, it can report the return codes of OS
processes to interested Erlang processes using the fun returned through
wrek_vert:exec. This fixes the nasty bug where a child process of the wrek_vert
callback process spawned OS processes using exec:run_link without trapping exits,
causing cascading process crashes when the OS process returned a non-zero exit
code.
Note: Verts that call wrek_vert:exec should change their match patterns to
account for the new {ok, _} | {error, _} return value.
lists:foreach(fun(From) ->
gen_server:reply(From, Result)
end, Waits),
Pids2 = Pids#{Pid => {result, Result}},
Copy link

Choose a reason for hiding this comment

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

Just to confirm, this map will not grow infinitely because it'll get wiped once the vert is done executing. Meaning that we don't reuse a vert process to run multiple instances of a vert.

Copy link

@RAttab RAttab left a comment

Choose a reason for hiding this comment

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

Looks good :)

@rkallos
Copy link
Owner Author

rkallos commented Jan 17, 2019 via email

@rkallos rkallos merged commit ed8f8a9 into master Jan 17, 2019
@rkallos rkallos deleted the fix/link-ospid-to-wrek-vert branch January 17, 2019 19:02
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.

None yet

2 participants