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/06/07 17:43:55 UTC
[GitHub] couchdb-chttpd pull request #125: Don't expect #vacc as a response of end_de...
GitHub user eiri opened a pull request:
https://github.com/apache/couchdb-chttpd/pull/125
Don't expect #vacc as a response of end_delayed_json_response in multi_query_view
When `multi_query_view` is calling `chttpd:end_delayed_json_response/1` it is passing it the response it received from query_view's `#vacc`, which means it'll get back a response record and not `#vacc`.
COUCHDB-3031
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloudant/couchdb-chttpd 67171-fix-multi_query_view-response
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-chttpd/pull/125.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 #125
----
----
---
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 #125: Don't expect #vacc as a response of end_de...
Posted by eiri <gi...@git.apache.org>.
Github user eiri commented on a diff in the pull request:
https://github.com/apache/couchdb-chttpd/pull/125#discussion_r66286884
--- Diff: src/chttpd_view.erl ---
@@ -33,8 +33,7 @@ multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
Acc1
end, VAcc1, ArgQueries),
{ok, Resp1} = chttpd:send_delayed_chunk(VAcc2#vacc.resp, "\r\n]}"),
- {ok, Resp2} = chttpd:end_delayed_json_response(Resp1),
- {ok, Resp2#vacc.resp}.
+ chttpd:end_delayed_json_response(Resp1).
--- End diff --
In `design_doc_view` the last thing we are calling `fabric:query_view/6` which _is_ returning vacc record. Here we are extracting response from vacc and then passing it through `chttpd:send_delayed_chunk/2` and `chttpd:end_delayed_json_response/1`. i.e. we are passing around delayed_resp records, but expecting to get as a result vacc record as Resp2.
I'm basically reverting `multi_query_view` to how it is in dbcore and how it was in Couch prior [this commit](https://github.com/apache/couchdb-chttpd/pull/94). Why do you think this is incorrect fix?
---
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 #125: Don't expect #vacc as a response of end_delayed_j...
Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on the issue:
https://github.com/apache/couchdb-chttpd/pull/125
+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 issue #125: Don't expect #vacc as a response of end_delayed_j...
Posted by eiri <gi...@git.apache.org>.
Github user eiri commented on the issue:
https://github.com/apache/couchdb-chttpd/pull/125
@iilyak `design_doc_view` used with POST and keys and that I did check, works fine. I haven't specially checked `all_docs_view`, but at first glance it looks like it should be good: vacc in -- vacc out. I think we'd notice if it'd be broken by now, it's not as esoteric as multi-query view
---
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 #125: Don't expect #vacc as a response of end_delayed_j...
Posted by iilyak <gi...@git.apache.org>.
Github user iilyak commented on the issue:
https://github.com/apache/couchdb-chttpd/pull/125
@eiri: Did you check other functions altered in the commit you've mentioned?
- chttpd_db:all_docs_view
- design_doc_view:design_doc
---
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 #125: Don't expect #vacc as a response of end_de...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/couchdb-chttpd/pull/125
---
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 #125: Don't expect #vacc as a response of end_de...
Posted by rnewson <gi...@git.apache.org>.
Github user rnewson commented on a diff in the pull request:
https://github.com/apache/couchdb-chttpd/pull/125#discussion_r66255916
--- Diff: src/chttpd_view.erl ---
@@ -33,8 +33,7 @@ multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
Acc1
end, VAcc1, ArgQueries),
{ok, Resp1} = chttpd:send_delayed_chunk(VAcc2#vacc.resp, "\r\n]}"),
- {ok, Resp2} = chttpd:end_delayed_json_response(Resp1),
- {ok, Resp2#vacc.resp}.
+ chttpd:end_delayed_json_response(Resp1).
--- End diff --
returning Resp2#vacc.resp matches what design_doc_view returns and both are called only from handle_view_req.
I've reproduced this crash and confirmed this change fixes it, but it feels like something deeper is wrong and the true fix is elsewhere.
---
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 #125: Don't expect #vacc as a response of end_delayed_j...
Posted by davisp <gi...@git.apache.org>.
Github user davisp commented on the issue:
https://github.com/apache/couchdb-chttpd/pull/125
This looks like the right fix to me. +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.
---