spawn_monitor() 和“DOWN”消息
(理论上) 是否有可能被 spawn_monitor()
处理的进程退出(正常退出或出错)而不向父进程发送 'DOWN'
消息?我有一个非常奇怪的进程泄漏,似乎有些进程没有发送 'DOWN'
消息。我使用的是 Ubuntu 9.10 附带的 Erlang 包。也许这是一个已知的错误?
Is it (theoretically) possible that the process that's been spawn_monitor()
'ed exits (with the normal exit or on error) without sending 'DOWN'
message to the parent process ? I have a very strange process leakage, it seems like some of the processes do not send 'DOWN'
message. I am using Erlang package that comes with Ubuntu 9.10. Maybe it is a known bug ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要显示一些代码。监控是 erlang 工作方式的核心。
很难说出你的实际问题是什么,因为你没有描述你所看到的,所以我不得不猜测。
您要么没有尝试接收关闭消息,要么该进程没有退出。
如果您有进程泄漏,听起来它们实际上并没有退出。
您很可能正在尝试构建自己的
supervisor
模块。如果您想要正常的进程树关闭和/或重新启动,我强烈建议使用 OTP 的主管。You'll need to show some code. Monitoring is pretty core to the way erlang works.
It's hard to tell what your actual problem is since you're not describing what you're seeing, so I'll have to guess.
You're either not trying to receive the down message or the process isn't exiting.
If you have processes leaking, it sounds like they're not actually exiting.
You very well may be trying to build your own
supervisor
module. I'd strongly suggest using OTP's supervisor if you want sane process tree shutdown and/or restart.也许您在某个时候取消了该流程?
从 erlang:demonitor/1 的文档中读取:
Maybe you demonitored the process at some point?
Reading from the doc for erlang:demonitor/1: