Any idea to resolve: connection failure using client memcached
Hi!
I'm doing some test with Couchbase server with the client of C. But when everything is running perfectly, the test stops saying that a "Connection failure" has happened.
My test is the next:
I have done a program which create a connection with the Couchbase server, insert data and after make some 'get's'. When I start with the 'get's', everything works great! But a while after, the server fails. The message of the error is "Connection failure".
I have written 'get's' because, really, i'm using the function lcb_make_http_request().
My idea is create a view at the same time that i'm inserting data. In order to do this, I use JSON and I store the data using lcb_store().
Now, I'm inserting 8GB of data. I did another prove with 1 GB and everything works perfectly.
Anyone can help me and give me any idea about the problem that I have?
Thanks a lot!!
Thanks for replying!
Well, first of all I create the instance with: lcb_create(&instance, &create_options) where I have just given values to 'create_options'.
Then I initialize the connection with: lcb_connect(instance) and I wait until this work finish: lcb_wait(instance).
After this, I start inserting data with: lcb_store(instance,NULL,1,cmds) where 'cmds' have a JSON string, and again I wait: lcb_wait(instance).
This part of the programme works with any problem!!!
The problems start from here.
When I finish to insert data, I start to make 'gets' with: lcb_make_http_request(instance,NULL,LCB_HTTP_TYPE_VIEW,&http_cmd,NULL); where 'http_cmd' are correctly initialize.
This works fine, but in one moment, the request start to fail...
I think that Couchbase collapses o something like that, but I don't know how to fix that!
Any idea?
Thanks!
do you mean you are making view request, parsing the result JSON and running GET queries along the way? or just execute view request and during result fetching receive the error in one of the callbacks?
you said that your server failed, right? what kind of error do you expect from the client in this case?
Could you post some code samples anywhere?
Cheers,
Trond