[OpenSIPS-Devel] Cachedb_Couchbase questions

Ryan Bullock rrb3942 at gmail.com
Fri Apr 19 21:37:03 CEST 2013


So this makes sense now.

The value that lcb_get_last_error returns is only set if an error callback
would have been called. However an error callback is only called if another
callback handler (eg a get handler) isn't already set for that action. In
this case the other handler (the get handler) is called and passed the
error, which we store in last_error and the internal error value is never
updated for lcb_get_last_error.

This makes it safe to just go off of last_error.

I've submitted a patch that makes this and other changes. Tracker ID 3611397
https://sourceforge.net/tracker/?func=detail&aid=3611397&group_id=232389&atid=1086412

Glad to answer any questions or hear any input on the changes.

Regards,

Ryan




On Thu, Apr 18, 2013 at 10:25 AM, Ryan Bullock <rrb3942 at gmail.com> wrote:

> Ok, I need to dig into this anyways so I will see what I can find and work
> up a patch based on that.
>
> Regards,
>
> Ryan
>
>
>
>
> On Thu, Apr 18, 2013 at 7:41 AM, Vlad Paiu <vladpaiu at opensips.org> wrote:
>
>> **
>> Hi Ryan,
>>
>> Wondered about that myself when the module was built, about why they
>> would have two different mechanisms for reporting errors. I included both
>> just for the sake of reporting all errors, but didn't see the
>> lcb_get_last_error() triggering.
>> I guess we need the help of some libcouchbase devs here, or dig into the
>> libcouchbase code to see when lcb_get_last_error() triggers and error.
>>
>> Best Regards,
>>
>> Vlad Paiu
>> OpenSIPS Developerhttp://www.opensips-solutions.com
>>
>>
>> On 04/18/2013 12:54 AM, Ryan Bullock wrote:
>>
>>   Hey all,
>>
>>  I am doing some work with opensips + couchbase and have started on a
>> patchset for the opensips couchbase driver to clean up a few things (better
>> error outputs, etc) and make some changes that we require before going
>> production.
>>
>>  One thing I am noticing are calls to lcb_get_last_error() after every
>> operation, even though the error on the callback is being stored in
>> last_error. In my quick testing the response from lcb_get_last_error()
>> seems to always be success even if the operation failed (such as due to a
>> connection failure), last_error shows the correct failure.
>>
>> I am wondering if the checks to lcb_get_last_error could be removed? Or
>> are their instances where it would show an error not caught by last_error?
>> I don't see many uses of lcb_get_last_error in the libcouchbase examples
>> and they seem to all go off the error in the callback. The benefit I see is
>> being able to more easily report useful and relevant errors.
>>
>>  Input welcome.
>>
>>  Regards,
>>
>> Ryan
>>
>>
>>
>> _______________________________________________
>> Devel mailing listDevel at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>>
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20130419/17e4f68e/attachment.htm>


More information about the Devel mailing list