Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Validate boolean parameters in /_replicate payload #47

Merged
merged 1 commit into from
Sep 1, 2016

Conversation

eiri
Copy link
Member

@eiri eiri commented Sep 1, 2016

Unlike /_replicator, end-point /_replicate doesn't check type for the boolean parameters in payload, which leads replicator to crash with case_clause.

This patch makes it to return "bad request" error on invalid input.

COUCHDB-3118

@iilyak
Copy link
Contributor

iilyak commented Sep 1, 2016

All tests pass locally. +1

======================== EUnit ========================
module 'json_stream_parse'
module 'couch_replicator_worker'
module 'couch_replicator_utils'
  ......
  couch_replicator_utils: check_convert_options_pass_test...[0.021 s] ok
  couch_replicator_utils: check_convert_options_fail_test...ok
  [done in 0.040 s]
  ......
      [done in 9.362 s]
    [done in 34.282 s]
  [done in 34.282 s]
=======================================================
  All 168 tests passed.
==> rel (eunit)
==> db.test (eunit)

@nickva
Copy link
Contributor

nickva commented Sep 1, 2016

+1

@asfgit asfgit merged commit b9232c8 into master Sep 1, 2016
@rnewson
Copy link
Member

rnewson commented Sep 6, 2016

please remember that couchdb is frozen for the 2.0 release, please stop merging new features or fixing that aren't 2.0 blockers.

@nickva @eiri @iilyak

@kxepal
Copy link
Member

kxepal commented Sep 6, 2016

@rnewson Why not to create a branch for 2.0 and prepare release from there while people still can work on new features and master? Sounds like gitflow-ish.

@rnewson
Copy link
Member

rnewson commented Sep 6, 2016

Committers to couchdb should be focused on making 2.0 happen. If they want to do other, unrelated work, they can keep it elsewhere for now.

asfgit pushed a commit that referenced this pull request Mar 14, 2017
httpc pool's terminate/2 can block up to 5 seconds in case when ssl sockets
are used. Previously this was not an issue as replication jobs would run until
completion and only exit once. With the scheduler, replication jobs are stopped
regularly during rescheduling. So terminate/2 could be called `max_churn` number
of times in a row during each reschedule cycle. This could lead to scheduler
gen_server being blocked for up to 100 seconds at a time.

To fix, unlink the connection and call stop in a separate process. This way,
socket will get a chance to be closed properly, but if it doesn't, ibrowse
client will kill it (this ensures connection processes won't leak).
@hubot hubot deleted the 3118-validate-_replicate-payload branch April 28, 2017 16:05
@hubot hubot restored the 3118-validate-_replicate-payload branch April 28, 2017 21:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants