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

Exception written to the log if db deleted while there is a change feed running

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      [info] 2016-09-14T20:08:23.217251Z node1@127.0.0.1 <0.23485.0> ea02496172 ea02496172 127.0.0.1  localhost:15984 DELETE /d1 200 ok 46
      
      [error] 2016-09-14T20:08:23.221676Z node1@127.0.0.1 <0.22945.0> -------- rexi_server error:{'EXIT',{{stop,{cb_state,<0.22937.0>,#Ref<0.0.1.15627>,true}},[{couch_event_listener_mfa,handle_event,3,[{file,"src/couch_event_listener_mfa.erl"},{line,91}]},{couch_event_listener,do_event,3,[{file,"src/couch_event_listener.erl"},{line,142}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"
      },{line,139}]}]}} [{couch_event_listener,do_event,3,[{file,"src/couch_event_listener.erl"},{line,150}]},{rexi_server,init_p,3,[{file,"src/rexi_server.erl"},{line,139}]}]
      
      [info] 2016-09-14T20:08:23.222174Z node1@127.0.0.1 <0.22898.0> 549ae68ef1 549ae68ef1 127.0.0.1  localhost:15984 GET /d1/_changes?feed=longpoll 200 ok 32901
      

      Appears in the log if a database gets deleted while there is a change feed running. Both longpoll or continuous seem to trigger the behavior.

      Exception above in couch_event_listener_mfa:handle_event comes from

      https://github.com/apache/couchdb-couch-event/blob/master/src/couch_event_listener_mfa.erl#L91

      which, in turn comes from fabric_db_update_listener handle_db_event returning {stop, St} in:

      https://github.com/apache/couchdb-fabric/blob/master/src/fabric_db_update_listener.erl#L87

      It seems couch_event_listerner_mfa:handle_event doesn’t handle {stop, St} only, {ok, NewState} or just stop or it raises an exception.

      I tried to replace {stop, St} with {ok, St} and then with stop. But in both cases change feeds never stopped.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vatamane Nick Vatamaniuc
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: