1. CouchDB
  2. COUCHDB-1309

File descriptor leaks on design document update and view cleanup


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


      If we add a design document with views defined in it, open the corresponding view group (by querying one of its views for e.g.), then update the design document in such a way that the view signature changes (changing a view's map function code for e.g), the old view group remains open forever (unless a server restart happens) and keeps it's view file reference counter active forever.
      If a view cleanup request comes, the old view file is not deleted since the reference counter is not dropped by the old view group, keeping the file descriptor in use forever.

      This leakage is different from what is reported in COUCHDB-1129 but it's somehow related.

      The attached patch, simply shutdowns a view group when the design document is updated and the new view signature changes, releasing the old view file descriptor (as soon as no more clients are using the old view).

      1. 0001-Fix-ets-lookup-case_clause-error-after-ddoc-is-updat.patch
        2 kB
        Filipe Manana
      2. master-0002-Shutdown-view-group-on-ddoc-update.patch
        12 kB
        Filipe Manana
      3. master-0002-Shutdown-view-group-on-ddoc-update.patch
        14 kB
        Filipe Manana
      4. master-0001-Add-ddoc_updated-event.patch
        4 kB
        Filipe Manana
      5. 12x-0002-Shutdown-view-group-on-ddoc-update.patch
        13 kB
        Filipe Manana
      6. 12x-0001-Add-ddoc_updated-event.patch
        4 kB
        Filipe Manana
      7. couchdb-1309_12x.patch
        12 kB
        Filipe Manana
      8. couchdb-1309_trunk.patch
        13 kB
        Filipe Manana

        Issue Links



            • Assignee:
              Filipe Manana
              Filipe Manana
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: