[ 
https://issues.apache.org/jira/browse/COUCHDB-1309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13129520#comment-13129520
 ] 

Benoit Chesneau commented on COUCHDB-1309:
------------------------------------------

Ok, the update detection can't happen in updater, if this isn't triggered. 

Anyway I think we could remove this other listener by reusing the update 
notification process in couch_index_server, something like (not tested):

http://friendpaste.com/7CwKM5clixdyuq6HWHjDDv

I'm also not sure we need to know the exact design id, isn't emitting an 
'refresh_indexes' event enough since we  have all the info in states to detect 
signature change if it happends? It woud remove this list in memory and extra 
event notifications. Something like :

http://friendpaste.com/44q84nzKSjaU15vX2sVkfF

I will try to send a complete patch later in the day, but not sure I will have 
time. Btw I'm only worrying about the trunk here. I think we have some time to 
solve this problem on trunk. No need for a quick fix.
                
> File descriptor leaks on design document update and view cleanup
> ----------------------------------------------------------------
>
>                 Key: COUCHDB-1309
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1309
>             Project: CouchDB
>          Issue Type: Bug
>            Reporter: Filipe Manana
>            Assignee: Filipe Manana
>         Attachments: couchdb-1309_12x.patch, couchdb-1309_trunk.patch
>
>
> 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).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to