You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by eiri <gi...@git.apache.org> on 2016/05/27 18:16:59 UTC

[GitHub] couchdb-chttpd pull request: Fix _node/$node/_system endpoint

GitHub user eiri opened a pull request:

    https://github.com/apache/couchdb-chttpd/pull/123

    Fix _node/$node/_system endpoint

    The endpoint is using the same handler as a backdoor interface, which only works for the requests to a local $node. For rpc calls to the remote nodes, as it's done on `/_node` endpoints, `handle_node_req` handler is getting `{badrpc,{'EXIT',normal}}` response and fails with `invalid_ejson` exception.
    
    The change splits stats gathering from stats responding, allowing to use former on both `/_node/$node/_system` and backend's `/_system`

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

    $ git pull https://github.com/cloudant/couchdb-chttpd 65878-fix-_node-_system-endpoint

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

    https://github.com/apache/couchdb-chttpd/pull/123.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 #123
    
----
commit f3209871eeedf9228c2ef1e35512a8128e0e8ba7
Author: Eric Avdey <ei...@eiri.ca>
Date:   2016-05-27T17:59:23Z

    Fix _node/$node/_system endpoint
    
    The endpoint was using the same handler as a backdoor interface,
    which only works for the requests to a local $node.
    
    For rpc calls to the remote nodes, as it's done on /_node endpoints,
    handle_node_req handler was getting {badrpc,{'EXIT',normal}} response
    and failed with invalid_ejson exception as a result.
    
    The change splits stats gathering from stats responding
    allowing to use former on both /_node/$node/_system and
    /_system on the backdoor interface.

----


---
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-chttpd pull request: Fix _node/$node/_system endpoint

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

    https://github.com/apache/couchdb-chttpd/pull/123#discussion_r64948608
  
    --- Diff: src/chttpd_misc.erl ---
    @@ -294,8 +295,9 @@ handle_node_req(#httpd{path_parts=[_, _Node, <<"_stats">>]}=Req) ->
         send_method_not_allowed(Req, "GET");
     % GET /_node/$node/_system
     handle_node_req(#httpd{method='GET', path_parts=[_, Node, <<"_system">>]}=Req) ->
    -    Stats = call_node(Node, chttpd_misc, handle_system_req, [Req]),
    -    chttpd:send_json(Req, Stats);
    +    Stats = call_node(Node, chttpd_misc, get_stats, []),
    +    EJSON = couch_stats_httpd:to_ejson(Stats),
    +    chttpd:send_json(Req, EJSON);
    --- End diff --
    
    Nitpick. Here you specify module name while [on line 341](https://github.com/apache/couchdb-chttpd/pull/123/files#diff-938aabd9888322523915339d0185cf7aR341) you don't specify module name. Both forms would work, but it is better to not mix them without a reason.


---
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-chttpd pull request #123: Fix _node/$node/_system endpoint

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

    https://github.com/apache/couchdb-chttpd/pull/123


---
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-chttpd issue #123: Fix _node/$node/_system endpoint

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

    https://github.com/apache/couchdb-chttpd/pull/123
  
    +1


---
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-chttpd pull request: Fix _node/$node/_system endpoint

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

    https://github.com/apache/couchdb-chttpd/pull/123
  
    +1


---
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-chttpd pull request: Fix _node/$node/_system endpoint

Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the pull request:

    https://github.com/apache/couchdb-chttpd/pull/123#issuecomment-222221511
  
    Other than a small nitpick it looks good to me.


---
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.
---