Skip to content

fix: prevent pmap from getting stuck forever#112

Merged
zhongwencool merged 1 commit intomasterfrom
0609-fix-pmap-error-handling
Jun 10, 2023
Merged

fix: prevent pmap from getting stuck forever#112
zhongwencool merged 1 commit intomasterfrom
0609-fix-pmap-error-handling

Conversation

@savonarola
Copy link
Contributor

No description provided.

receive
{result, Pid, {normal, Result}} -> Result;
{result, Pid, {crash, {C, E, ST}}} -> erlang:raise(C, E, ST);
{result, Pid, {crash, {C, E, ST}}} -> {error, {El, {C, E, ST}}};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If pmap caller traps exits, then in case of crash it was stuck forever because:

  • the caller pid receives EXIT as a message
  • but it never handles it, because pmap_exec process crashes and timeout message is not sent, so pmap_gather waits forever.

@savonarola savonarola requested a review from zhongwencool June 9, 2023 10:56
@zhongwencool zhongwencool merged commit d5d978b into master Jun 10, 2023
@zhongwencool zhongwencool deleted the 0609-fix-pmap-error-handling branch June 10, 2023 11:19
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