OpenSIPS/opensips — pull request #106 by rrb3942 (2013-10-15 21:11:49+00:00)
Title: Switches to LCB_SYNCHRONOUS. Enables better reconnect support with command retry as well as a lazy_connect option.

1. This patch switches the use of libcouchbase into synchronous mode which helps simplify its use (no longer requires manual calls to lcb_wait and only a single error code needs to be checked).

2. Taking advantage of point 1, I was able to more easily add retrying a command after a successful reconnect.

3. The 'lazy_connect' option is also added, which delays making the connection to couchbase until the connection is actually used. If you are connecting to multiple buckets and run many opensips children it can be time consuming to make all the connections on startup. This option takes advantage of point 2, by leaving the couchbase instance in a temp failure mode and leaves the reconnect + retry logic to take care of the initial connection.

It also adds a few error codes to the list to reconnect on, these additions are based on the experience of connections getting stuck in production because of them.

Please let me know if you have any questions.