Is there a way to control the CDB client timeout interval?

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.

Worth mentioning here are the related timeouts:

Applicable to all:

/confdConfig/capi/connectTimeout (xs:duration) [PT60S]

Timeout for a daemon to send initial message after connecting the socket to the confd server. If the daemon fails to initiate the connection within the given time, it will be disconnected.

DP API control socket:

/confdConfig/capi/newSessionTimeout (xs:duration) [PT30S] 

Timeout for a daemon to respond to a control socket request, see confd_lib_dp(3). If the daemon fails to respond within the given time, it will be disconnected.

DP API worker socket - a common use-case is that you have an Action that takes as long time to complete:

/confdConfig/capi/queryTimeout (xs:duration) [PT120S]

Timeout for a daemon to respond to a worker socket query, see confd_lib_dp(3). If the daemon fails to respond within the given time, it will be disconnected.

Event subscribers:

/confdConfig/capi/eventReplyTimeout (xs:duration) [PT120S]

Timeout for the reply from an event notification subscriber for a notification that requires a reply, see confd_lib_events(3). If the subscriber fails to reply within the given time, the notification socket will be closed.