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

Make supervision tree fetching more error proof #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gomoripeti
Copy link
Contributor

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 #37

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
@baransu
Copy link
Contributor

baransu commented Jun 1, 2017

So if some branch of sup-tree is not OTP correct for example it would skip whole branch?

@gomoripeti
Copy link
Contributor Author

I think in most cases a worker child is incorrectly declared as a supervisor child so there are no grandchildren and it is safe to handle this process as a leaf.
If this process is a custom parent which has children but does not implement the which_children api then, yes, the subtree under it would be ignored. But in this case epl would have a hard time to figure out grandchildren anyway.
(I only know of rabbitmq which has its own supervisor implementation, but it also supports the which_children call)

@baransu
Copy link
Contributor

baransu commented Jun 1, 2017

We want to enforce correct OTP structure so rather throw error than ignore something incorrect.

/ cc @michalslaski

@arkgil
Copy link
Contributor

arkgil commented Jun 4, 2017

Or instead of throwing an error we could show an information in the UI that this branch of the tree cannot be resolved.

@gomoripeti
Copy link
Contributor Author

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.

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.

Crashes wobserver
3 participants