couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <>
Subject Re: 2 Posts at once causes problems
Date Fri, 06 Apr 2012 06:56:42 GMT
On Thu, Apr 5, 2012 at 15:30, ashgavs <> wrote:
> I did some testing on my client, and made two posts that get posted at
> exactly the same time.  We have long polling enabled so I waited for a GET
> to see if both made it successfully into the DB.  Both posts went out, but
> we only got one GET back. So I checked the database, it had both documents.
> So what happened? Why did one get lost?

If you re-issue the long poll GET with the last_seq returned do you
see the other POST?
It is expected that long polling may only give you the first of the
two POST if the GET was initiated before the POST.

> The robot makes literally thousands of posts in a short period of time. Its
> constantly sending the DB information. My theory is that if a user and the
> robot make a post at exactly the same time, its possible that the user will
> not GET back both posts from the DB, almost like a threading issue. Do you
> have any thoughts? Have you seen anything like this before?

If you are starting the GET at the same time as the POST there could
have been a small race condition:


View raw message