You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by Bob Dionne <di...@dionne-associates.com> on 2012/02/22 04:30:06 UTC

replicator

Hi Filipe,

I'm seeing an issue in the replicator. This anonymous function [1] is throwing function_clause errors as it doesn't handle codes 400-500 that might occur in [2,3]. I have a rough idea how to fix it but I'm not sure whether I should handle it in replicator_httpc or up in the callback. Does this ring a bell? Opinions?

Cheers,

Bob

[1] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_api_wrap.erl#L335
[2] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_httpc.erl#L90
[3] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_httpc.erl#L111

Re: replicator

Posted by Bob Dionne <di...@dionne-associates.com>.
On Feb 21, 2012, at 11:00 PM, Filipe David Manana wrote:

> On Tue, Feb 21, 2012 at 7:30 PM, Bob Dionne
> <di...@dionne-associates.com> wrote:
>> Hi Filipe,
>> 
>> I'm seeing an issue in the replicator. This anonymous function [1] is throwing function_clause errors as it doesn't handle codes 400-500 that might occur in [2,3].
> 
> Right, like in some other places we don't deal with all possible http
> status codes, only a subset that are expected (success or otherwise).

I can see that, except in this case the funs that use the callback do so in clauses that explicitly test for >= 400 and <= 500

I'm seeing the 400 in long running pull replications from BigCouch. I'm not sure of the underlying cause yet but I'll run it down and let you know

Thanks,

Bob


> Which http status code are you receiving? How to reproduce that?
> 
> I have a rough idea how to fix it but I'm not sure whether I should
> handle it in replicator_httpc or up in the callback. Does this ring a
> bell? Opinions?
>> 
>> Cheers,
>> 
>> Bob
>> 
>> [1] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_api_wrap.erl#L335
>> [2] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_httpc.erl#L90
>> [3] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_httpc.erl#L111
> 
> 
> 
> -- 
> Filipe David Manana,
> 
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."


Re: replicator

Posted by Filipe David Manana <fd...@apache.org>.
On Tue, Feb 21, 2012 at 7:30 PM, Bob Dionne
<di...@dionne-associates.com> wrote:
> Hi Filipe,
>
> I'm seeing an issue in the replicator. This anonymous function [1] is throwing function_clause errors as it doesn't handle codes 400-500 that might occur in [2,3].

Right, like in some other places we don't deal with all possible http
status codes, only a subset that are expected (success or otherwise).
Which http status code are you receiving? How to reproduce that?

I have a rough idea how to fix it but I'm not sure whether I should
handle it in replicator_httpc or up in the callback. Does this ring a
bell? Opinions?
>
> Cheers,
>
> Bob
>
> [1] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_api_wrap.erl#L335
> [2] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_httpc.erl#L90
> [3] https://github.com/bdionne/couchdb/blob/master/src/couch_replicator/src/couch_replicator_httpc.erl#L111



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."