You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/02/17 21:30:18 UTC

[GitHub] [couchdb] eiri opened a new pull request #3373: Read and validate JSON payload on POST to _changes

eiri opened a new pull request #3373:
URL: https://github.com/apache/couchdb/pull/3373


   ## Overview
   
   During `POST` on `/{db}/_changes` with a custom filter, nodes attempt to [read the request payload](https://github.com/apache/couchdb/blob/3.x/src/couch/src/couch_changes.erl#L241), unless the request body already stored on a request record. When this is happening on a node foreign to the original http request, reader process quits with `exit:normal` and as a result the whole fabric request hangs until a timeout.
   
   This patch switches filter reader to `chttpd_external:json_req_obj/2` for more descriptive exit message, adds reading of the payload on the request handler and validates that payload, when present, is a proper JSON object.
   
   ## Testing recommendations
   
   Related tests been added to the elixir tests
   
   `make elixir tests=test/elixir/test/changes_test.exs`
   
   ## Related Issues or Pull Requests
   
   Closes #3087 
   
   ## Checklist
   
   - [x] Code is written and works correctly
   - [x] Changes are covered by tests
   - [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] eiri merged pull request #3373: Read and validate JSON payload on POST to _changes

Posted by GitBox <gi...@apache.org>.
eiri merged pull request #3373:
URL: https://github.com/apache/couchdb/pull/3373


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [couchdb] eiri commented on pull request #3373: Read and validate JSON payload on POST to _changes

Posted by GitBox <gi...@apache.org>.
eiri commented on pull request #3373:
URL: https://github.com/apache/couchdb/pull/3373#issuecomment-780923794


   @nickva good idea! Done in #3374 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org