Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25EEE980A for ; Thu, 26 Apr 2012 12:06:18 +0000 (UTC) Received: (qmail 48714 invoked by uid 500); 26 Apr 2012 12:06:17 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 48663 invoked by uid 500); 26 Apr 2012 12:06:17 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 48655 invoked by uid 99); 26 Apr 2012 12:06:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 12:06:17 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fdmanana@gmail.com designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pb0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 12:06:09 +0000 Received: by pbcuo15 with SMTP id uo15so3654827pbc.11 for ; Thu, 26 Apr 2012 05:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=na6AhDDhPwX7oxjoxDZRpzucXsVYYdHoo7MN/EGQmzs=; b=BSBD+avpbDs88uQ0nCJpVA2YlqQQw0YoBizDDsJdu7rzrrFNdgUFcIZhf/hnl9m4uF 6/OGpgv/+MQ38AdO2+ygsOYPK2UglUeSaqTp3sw4n2BID9iMjoGKAdxFTFOhxRew+Hr0 zcoEbMiYiyR8QwoGEPFTLoYFlIXGlh561SdiJC43En8cMFAoS3/ME32XYKP4niN4zdjB wzdTCD8ZMU4d6GowAQvXmKaSoMUoG8h1cB1ULdE9isynK5Y0QVhxBHLnR7RkjZ6lsZKn mhY668H8f1vxfcX9nEvM0ttTquAYisAywHm0zwYWr9mfsYYiBWAuhR3FO6mn/ESm8Srl /8+g== MIME-Version: 1.0 Received: by 10.68.131.101 with SMTP id ol5mr6284755pbb.54.1335441948122; Thu, 26 Apr 2012 05:05:48 -0700 (PDT) Received: by 10.142.136.5 with HTTP; Thu, 26 Apr 2012 05:05:48 -0700 (PDT) Reply-To: fdmanana@gmail.com In-Reply-To: References: <20120425221825.0D5A2E588@tyr.zones.apache.org> Date: Thu, 26 Apr 2012 13:05:48 +0100 Message-ID: Subject: Re: [2/8] git commit: Fixing the replicator_db JS test From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Apr 26, 2012 at 12:26 PM, Benoit Chesneau wro= te: > On Thu, Apr 26, 2012 at 12:18 AM, =C2=A0 wrote: >> Fixing the replicator_db JS test >> >> >> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo >> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/6c976bd9 >> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/6c976bd9 >> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/6c976bd9 >> >> Branch: refs/heads/master >> Commit: 6c976bd948565305c006746f449dc8cd21a749e1 >> Parents: 7d2fe95 >> Author: Paul Joseph Davis >> Authored: Mon Mar 26 15:17:02 2012 -0500 >> Committer: Paul Joseph Davis >> Committed: Wed Apr 25 16:54:08 2012 -0500 >> >> ---------------------------------------------------------------------- >> =C2=A0share/www/script/test/replicator_db.js =C2=A0 =C2=A0 =C2=A0 =C2=A0= | =C2=A0 =C2=A04 ++++ >> =C2=A0src/couch_replicator/src/couch_replicator.erl | =C2=A0 =C2=A05 +++= +- >> =C2=A02 files changed, 8 insertions(+), 1 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/couchdb/blob/6c976bd9/share/www/s= cript/test/replicator_db.js >> ---------------------------------------------------------------------- >> diff --git a/share/www/script/test/replicator_db.js b/share/www/script/t= est/replicator_db.js >> index 48ca341..edc85f4 100644 >> --- a/share/www/script/test/replicator_db.js >> +++ b/share/www/script/test/replicator_db.js >> @@ -1076,6 +1076,10 @@ couchTests.replicator_db =3D function(debug) { >> =C2=A0 =C2=A0 }); >> =C2=A0 =C2=A0 TEquals(200, xhr.status); >> >> + =C2=A0 =C2=A0// Temporary band-aid, give the replicator db some >> + =C2=A0 =C2=A0// time to make the switch >> + =C2=A0 =C2=A0wait(500); >> + >> =C2=A0 =C2=A0 new_doc =3D { >> =C2=A0 =C2=A0 =C2=A0 _id: "foo666", >> =C2=A0 =C2=A0 =C2=A0 value: 666 >> >> http://git-wip-us.apache.org/repos/asf/couchdb/blob/6c976bd9/src/couch_r= eplicator/src/couch_replicator.erl >> ---------------------------------------------------------------------- >> diff --git a/src/couch_replicator/src/couch_replicator.erl b/src/couch_r= eplicator/src/couch_replicator.erl >> index 1f7c08a..e91e1ae 100644 >> --- a/src/couch_replicator/src/couch_replicator.erl >> +++ b/src/couch_replicator/src/couch_replicator.erl >> @@ -112,7 +112,7 @@ async_replicate(#rep{id =3D {BaseId, Ext}, source = =3D Src, target =3D Tgt} =3D Rep) -> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 RepChildId, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {gen_server, start_link, [?MODULE, Rep, [{ti= meout, Timeout}]]}, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 temporary, >> - =C2=A0 =C2=A0 =C2=A0 =C2=A01, >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0250, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 worker, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 [?MODULE] >> =C2=A0 =C2=A0 }, >> @@ -333,6 +333,9 @@ do_init(#rep{options =3D Options, id =3D {BaseId, Ex= t}} =3D Rep) -> >> =C2=A0 =C2=A0 }. >> >> >> +handle_info(shutdown, St) -> >> + =C2=A0 =C2=A0{stop, shutdown, St}; >> + >> =C2=A0handle_info({'DOWN', Ref, _, _, Why}, #rep_state{source_monitor = =3D Ref} =3D St) -> >> =C2=A0 =C2=A0 ?LOG_ERROR("Source database is down. Reason: ~p", [Why]), >> =C2=A0 =C2=A0 {stop, source_db_down, St}; >> > > > Never had an issue there. What was the problem? I have the feeling it > may be related to > > https://issues.apache.org/jira/browse/COUCHDB-1461 Why? Afaik Paul's changes are to increase the shutdown time (from 1ms to 250ms) and to avoid the noisy OTP error messages when a running replication is cancelled (shutdown handle_info clause). However I would be highly surprised if it fixes the issue you reported. > > - beno=C3=AEt --=20 Filipe David Manana, "Reasonable men adapt themselves to the world. =C2=A0Unreasonable men adapt the world to themselves. =C2=A0That's why all progress depends on unreasonable men."