Make supervision tree fetching more error proof#57
Make supervision tree fetching more error proof#57gomoripeti wants to merge 1 commit intoerlanglab:masterfrom
Conversation
If a child is wrongly specified as `supervisor`, but it does not implement this behaviour, the `supervisor:which_children/0` call can return unpredictable values. (Especially if the worker is a `gen_server` which can return any sort of funny value in its `handle_call`). This issue has been seen in more than one open-source library. Hopefully closes erlanglab#37
|
So if some branch of sup-tree is not OTP correct for example it would skip whole branch? |
|
I think in most cases a |
|
We want to enforce correct OTP structure so rather throw error than ignore something incorrect. / cc @michalslaski |
|
Or instead of throwing an error we could show an information in the UI that this branch of the tree cannot be resolved. |
|
It makes total sense not to hide the discrepancy. The easiest way would be to just crash with a very descriptive error message. But it would be more user-friendly to either print an error message (only once and not every second when the sup-tree is updated) or indicate this in the UI somehow. If it is not just a crash I would like to leave the implementation to you guys. |
If a child is wrongly specified as
supervisor, but it does notimplement this behaviour, the
supervisor:which_children/0call canreturn unpredictable values. (Especially if the worker is a
gen_serverwhich can return any sort of funny value in its
handle_call).This issue has been seen in more than one open-source library.
Hopefully closes #37