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 1C7CB9C8D for ; Thu, 26 Apr 2012 12:23:44 +0000 (UTC) Received: (qmail 3693 invoked by uid 500); 26 Apr 2012 12:23:43 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 3629 invoked by uid 500); 26 Apr 2012 12:23:43 -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 3615 invoked by uid 99); 26 Apr 2012 12:23:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 12:23:43 +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 (athena.apache.org: domain of bchesneau@gmail.com designates 209.85.215.180 as permitted sender) Received: from [209.85.215.180] (HELO mail-ey0-f180.google.com) (209.85.215.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2012 12:23:37 +0000 Received: by eaal12 with SMTP id l12so319870eaa.11 for ; Thu, 26 Apr 2012 05:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=Sn5F5neX4qPmmlQR7D4RgzgG0lOIjM6Ga+3chOgRofE=; b=f+yrvAl+E01tb+JvHLW6FEjMM4KqK7QbZ27buSxGsGhCtBvwVhnsZ+sSQ5ijdM0J6x 7/nmsYZYChUK22VsPUVOTxrM39kILXV67o1Aj7oQPYzBfnXn+gxZQAVTgeKMBoje0uVP miGC4qlyCJOklMdiB1V/7E/znGamaVNofuJEyg880srXh+6+JbVNEFzyMomc9xlxlFce VA62MCBrpMsYjUWDSjNMSzhZV2VYXeSLAmx+TqoWScyk3flwKfRS9HoXFW4HNWtORVY9 i0m8PQ1VYiA9kAxtLdw60klj+rh0Kl87tKcACurrgurEv1fEpJ8x4mYF4DgLBVGeOaCs ykRA== MIME-Version: 1.0 Received: by 10.14.39.197 with SMTP id d45mr1400957eeb.89.1335442996036; Thu, 26 Apr 2012 05:23:16 -0700 (PDT) Received: by 10.14.210.201 with HTTP; Thu, 26 Apr 2012 05:23:16 -0700 (PDT) In-Reply-To: References: <20120425221825.0D5A2E588@tyr.zones.apache.org> Date: Thu, 26 Apr 2012 14:23:16 +0200 Message-ID: Subject: Re: [2/8] git commit: Fixing the replicator_db JS test From: Benoit Chesneau To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Apr 26, 2012 at 2:18 PM, Filipe David Manana w= rote: > On Thu, Apr 26, 2012 at 1:10 PM, Benoit Chesneau wr= ote: >> On Thu, Apr 26, 2012 at 2:05 PM, Filipe David Manana wrote: >>> On Thu, Apr 26, 2012 at 12:26 PM, Benoit Chesneau = wrote: >>>> On Thu, Apr 26, 2012 at 12:18 AM, =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/6c976bd= 9 >>>>> 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 >>>>> >>>>> ---------------------------------------------------------------------= - >>>>> =A0share/www/script/test/replicator_db.js =A0 =A0 =A0 =A0| =A0 =A04 += +++ >>>>> =A0src/couch_replicator/src/couch_replicator.erl | =A0 =A05 ++++- >>>>> =A02 files changed, 8 insertions(+), 1 deletions(-) >>>>> ---------------------------------------------------------------------= - >>>>> >>>>> >>>>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/6c976bd9/share/ww= w/script/test/replicator_db.js >>>>> ---------------------------------------------------------------------= - >>>>> diff --git a/share/www/script/test/replicator_db.js b/share/www/scrip= t/test/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) { >>>>> =A0 =A0 }); >>>>> =A0 =A0 TEquals(200, xhr.status); >>>>> >>>>> + =A0 =A0// Temporary band-aid, give the replicator db some >>>>> + =A0 =A0// time to make the switch >>>>> + =A0 =A0wait(500); >>>>> + >>>>> =A0 =A0 new_doc =3D { >>>>> =A0 =A0 =A0 _id: "foo666", >>>>> =A0 =A0 =A0 value: 666 >>>>> >>>>> http://git-wip-us.apache.org/repos/asf/couchdb/blob/6c976bd9/src/couc= h_replicator/src/couch_replicator.erl >>>>> ---------------------------------------------------------------------= - >>>>> diff --git a/src/couch_replicator/src/couch_replicator.erl b/src/couc= h_replicator/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) -> >>>>> =A0 =A0 =A0 =A0 RepChildId, >>>>> =A0 =A0 =A0 =A0 {gen_server, start_link, [?MODULE, Rep, [{timeout, Ti= meout}]]}, >>>>> =A0 =A0 =A0 =A0 temporary, >>>>> - =A0 =A0 =A0 =A01, >>>>> + =A0 =A0 =A0 =A0250, >>>>> =A0 =A0 =A0 =A0 worker, >>>>> =A0 =A0 =A0 =A0 [?MODULE] >>>>> =A0 =A0 }, >>>>> @@ -333,6 +333,9 @@ do_init(#rep{options =3D Options, id =3D {BaseId,= Ext}} =3D Rep) -> >>>>> =A0 =A0 }. >>>>> >>>>> >>>>> +handle_info(shutdown, St) -> >>>>> + =A0 =A0{stop, shutdown, St}; >>>>> + >>>>> =A0handle_info({'DOWN', Ref, _, _, Why}, #rep_state{source_monitor = =3D Ref} =3D St) -> >>>>> =A0 =A0 ?LOG_ERROR("Source database is down. Reason: ~p", [Why]), >>>>> =A0 =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. >> >> I understand the change, but I don't know what is the problem . I may >> have misinterpreted what was the switch in question. But this is quite >> similar since stopping (deleting a doc) or canceling are both calling >> the same function, aren't they? > > Right. But the issue you reported before is unrelated. The problem > there is that 2 processes are calling 2 functions of the same > supervisor (start_child and delete_child). Those supervisor functions > are synchronous, meaning that one has to wait for the other to finish. > >> Ok thanks for the answer :) - beno=EEt