Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-206

exiting update_notification process crashes view_manager

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.9
    • 0.9
    • Database Core
    • 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.

      Attachments

        1. update_notification.diff
          1 kB
          Adam Kocoloski

        Activity

          People

            Unassigned Unassigned
            kocolosk Adam Kocoloski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified