Fast Computer, Race Condition (Java Client)
I'm not sure if this is limited to talking to couchbase 2.0 preview 3 (we haven't tested on 1.8), but if we call the constructor for couchbase client and immediately do a "get" operation, we get errors about connecting and then finally have our operation cancelled. After this point, the couchbase client seems to work.
It's almost as if there is a race condition upon starting the IO threads, but I'm not certain of that.
The only way we have been able to fix this is to add a Thread.sleep immediately after the couchbase constructor. That seems to give the couchbase client code enough time to do what it needs to do to accept our initial get operation.
Is this a known race condition? Also, if not - is there a better way to detect that couchbase is "ready to receive commands" than an arbitrary delay?
Thanks!
There is a known race condition, yes. There is a plan to fix it as well, but it hasn't been added yet.
Once the client is up and running though, you should only see error conditions if something goes wrong. See http://www.couchbase.com/issues/browse/JCBC-27