You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/08/10 20:07:20 UTC

[jira] [Commented] (COUCHDB-3096) Fix config listener handler accumulation

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

ASF subversion and git services commented on COUCHDB-3096:
----------------------------------------------------------

Commit b1b56054752287c806d9cf5927d1a5f02e09c420 in couchdb-config's branch refs/heads/master from [~paul.joseph.davis]
[ https://git-wip-us.apache.org/repos/asf?p=couchdb-config.git;h=b1b5605 ]

Fix config listener event handler registration

We rely on `gen_event:add_sup_handler/3` to remove handlers when the
process that registered for events exits. On master this was changed so
that config becomes the process that's monitored by gen_event. As such
any handler that is registered (say, for when an index is opened) adds a
handler to the config_event gen_event process. Since the config process
never exits these handlers are never removed.

The end result of all of this is that on a busy cluster the config_event
process will end up with millions of handlers consuming many gigabytes
of RAM.

This change creates a monitor process for every event handler. This
monitors the process wanting to listen for config changes and exits when
the requesting process exits. This means that we maintain our pure
callback API improvement while correctly removing handlers.

COUCHDB-3096


> Fix config listener handler accumulation
> ----------------------------------------
>
>                 Key: COUCHDB-3096
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-3096
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>            Reporter: Paul Joseph Davis
>
> We found an issue in production with config listeners piling up in the config_event gen_event server. This was due to how we fixed the API inconsistencies. We had re-parented the handler supervision to the config gen_server instead of the process that wanted config notifications. This means that since config never dies the handlers are never removed. The proposed patch just removes the config gen_server and uses a dedicated gen_server per event handler that handles the gen_event_EXIT messages. PR incoming after I have a ticket number.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)