Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9
-
None
-
r733674
Description
To reproduce, add an update_notification
sleep = /bin/sleep 5
and start CouchDB. When sleep returns, the os_process gen_server linked to it stops and that initiates a chain of crashes that brings down the view_manager.
The problem is that the update_notifier gen_event code doesn't handle
{'EXIT', Pid, Reason}messages where Pid is not the state of that particular event handler. The db_update event manager traps exits and forwards the 'EXIT' message to all registered event handlers. As a result, when any gen_server linked to the event manager terminates it brings down all the other event handlers with it, including the one added by couch_view. When that event handler goes down, the event_sup gen_server linked to it exits, and that brings down couch_view itself.
The fix is simple: just add one more clause to couch_db_update_notifier:handle_info that ignores 'EXIT' messages if the Pid does not match the Pid of the related os_process. I'll attach a patch to this issue.