Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace proc_lib:spawn_link/1 with spawn_link/1
Replace proc_lib:spawn_link/1 with just spawn_link/1 because the former reports expected process exits as crashes if SASL is enabled. Reported by Sonic Gao.
- Loading branch information
Showing
3 changed files
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3008ee3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hdima Why do you call exit explicitly instead of leaving process to finish after call_mfa/3?
3008ee3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maximvl Because I want to receive the return value. There's an example:
3008ee3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hdima But then sasl reports crash for every call from python, why not use monitors instead?
3008ee3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maximvl Don't really see your point here. This commit fixes the issue so now these processes won't be handled by SASL.
Originally I started with
proc_lib:spawn_link/1
because it's a good idea to use it in most cases. However I missed the SASL case. In this commitproc_lib:spawn_link/1
was replaced with plainerlang:spawn_link/1
so now these processes won't be handled by SASL at all. There's also a way to fix it and still useproc_lib:spawn_link/1
but I decided that in this caseerlang:spawn_link/1
will be better.In this case it's better to use linked processes because it's a good idea to crash all the worker processes if main erlport process crashed. Also it doesn't matter for SASL if a process linked, monitored or neither - it's just reports crash if process exits with an unexpected exit value.
3008ee3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hdima I see, problem is solved, thanks for explanation!