You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by iilyak <gi...@git.apache.org> on 2016/08/19 23:04:29 UTC

[GitHub] couchdb-couch-index pull request #18: Update handle_config_terminate API

GitHub user iilyak opened a pull request:

    https://github.com/apache/couchdb-couch-index/pull/18

    Update handle_config_terminate API

    Update handle_config_terminate API to match changes in apache/couchdb-config#11
    
    COUCHDB-3102


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cloudant/couchdb-couch-index 3102-fix-config_subscription

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch-index/pull/18.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18
    
----
commit 56fefe98d1af59e1d0628e20d7583dd175d6f6db
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2016-08-17T18:50:54Z

    Update handle_config_terminate API
    
    COUCHDB-3102

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-index pull request #18: Update handle_config_terminate API

Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-index/pull/18#discussion_r75912953
  
    --- Diff: src/couch_index.erl ---
    @@ -344,25 +340,19 @@ handle_info({'DOWN', _, _, _Pid, _}, #st{mod=Mod, idx_state=IdxState}=State) ->
         Args = [Mod:get(db_name, IdxState), Mod:get(idx_name, IdxState)],
         couch_log:info("Index shutdown by monitor notice for db: ~s idx: ~s", Args),
         catch send_all(State#st.waiters, shutdown),
    -    {stop, normal, State#st{waiters=[]}}.
    -
    +    {stop, normal, State#st{waiters=[]}};
    +handle_info({config_change, "query_server_config", "commit_freq", NewDelay, _}, State) ->
    +    handle_cast({config_change, NewDelay}, State);
    +handle_info({gen_event_EXIT, _Handler, _Reason}, State) ->
    +    erlang:send_after(?RELISTEN_DELAY, self(), restart_config_listener),
    +    {noreply, State};
    +handle_info(restart_config_listener, State) ->
    +    ok = config:subscribe_for_changes([{"query_server_config", "commit_freq"}]),
    --- End diff --
    
    +1 to adding a define.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-index pull request #18: Update handle_config_terminate API

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-index/pull/18#discussion_r75572589
  
    --- Diff: src/couch_index.erl ---
    @@ -344,25 +340,19 @@ handle_info({'DOWN', _, _, _Pid, _}, #st{mod=Mod, idx_state=IdxState}=State) ->
         Args = [Mod:get(db_name, IdxState), Mod:get(idx_name, IdxState)],
         couch_log:info("Index shutdown by monitor notice for db: ~s idx: ~s", Args),
         catch send_all(State#st.waiters, shutdown),
    -    {stop, normal, State#st{waiters=[]}}.
    -
    +    {stop, normal, State#st{waiters=[]}};
    +handle_info({config_change, "query_server_config", "commit_freq", NewDelay, _}, State) ->
    +    handle_cast({config_change, NewDelay}, State);
    +handle_info({gen_event_EXIT, _Handler, _Reason}, State) ->
    +    erlang:send_after(?RELISTEN_DELAY, self(), restart_config_listener),
    +    {noreply, State};
    +handle_info(restart_config_listener, State) ->
    +    ok = config:subscribe_for_changes([{"query_server_config", "commit_freq"}]),
    --- End diff --
    
    Feels like if we have a single place where we do subscribe for certain config keys will save us from mistakes, when we forgot to update a second `config:subscribe_for_changes` call. Or at least if we'll use `define` for what we subscribe.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-index pull request #18: Update handle_config_terminate API

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-couch-index/pull/18


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch-index issue #18: Update handle_config_terminate API

Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on the issue:

    https://github.com/apache/couchdb-couch-index/pull/18
  
    +1 after the suggestion from @kxepal 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---