The following parameter in confd.conf can be used to specify the CDB client timeout interval:
/confdConfig/cdb/clientTimeout (xs:duration|infinity) [infinity]
When left unspecified, it defaults to infinity. CDB will never timeout waiting for a response from a client. A client which doesn’t respond will have its socket closed. Otherwise, clientTimeout specifies how long CDB should wait while a client performs a certain action, before considering that client unresponsive.
The timeout is applied to clients in the following situations:
• When a reader client calls cdb_start_session() it must end it with cdb_end_session() within the timeout period.
• When a subscription client receives a subscription notification, it must respond with a call to cdb_sync_subscription_socket() within the timeout period.
During development it can be useful to set a low timeout to catch programming errors. In a production system use “infinity” (default) or a high timeout so as not to timeout during high CPU load.
There also exists a CDB API called:
int cdb_set_timeout(int sock, int timeout_secs);
that can be used to dynamically extend (or shorten) the timeout for the current action. Thus it is possible to configure a restrictive timeout in confd.conf, but still allow specific actions to have a longer execution time.
This CDB API can be called either with a subscription socket during subscription delivery on that socket (including from the iter() function passed to cdb_diff_iterate()), or with a data socket that has an active session. The timeout is given in seconds from the point in time when the function is called.