CouchDB
  1. CouchDB
  2. COUCHDB-206

exiting update_notification process crashes view_manager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9
    • Component/s: Database Core
    • Labels:
      None
    • Environment:

      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.

        Activity

        Hide
        Jan Lehnardt added a comment -

        Committed as of r737334. Thanks Adam.

        Show
        Jan Lehnardt added a comment - Committed as of r737334. Thanks Adam.

          People

          • Assignee:
            Unassigned
            Reporter:
            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

                Development