Makes sense. We could fix this by just flipping to idle as soon as we get back 
the response header from the server if there is no immediate body but one thing 
at a time. I'll put back in the 'normal' then 'longpoll' logic and submit the 
PR.

Thanks,

    Yaron    
________________________________________
From: [email protected] <[email protected]> on 
behalf of Jens Alfke <[email protected]>
Sent: Tuesday, September 23, 2014 3:20 PM
To: [email protected]
Cc: Traun Leyden
Subject: Re: Normal and Longpoll

No; the scenario I mean is much more common. It looks like:

- Pull replicator starts up, sets state=active
- Client sends a _changes request with since=12345 (i.e. the last sequence it 
got from the server) and feed=longpoll
- Server has no changes since 12345, so it doesn't send any response
- Nothing happens on the client side, so state remains active
- Replicator sits idle for an indefinite time with the state still 'active', 
which is wrong.

By changing the feed to 'normal' for the first request, the response comes back 
immediately. If it's empty, the replicator knows it's already caught up and can 
quickly change its state to idle.

--Jens

--
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/7C6849C0-4BAF-4A9D-83A2-600B89111BC3%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/1411511105424.53737%40microsoft.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to