Description
We set n1ql_timeout / analytics_timeout based on execution_timeout as:
data_.n1ql_timeout =
|
static_cast<lcb_U32>(h_config->execution_timeout < 3
|
? 500000
|
: (h_config->execution_timeout - 2) * 1000000);
|
If h_config->execution_timeout is high enough the result of the following expression goes beyond the uint32 limit:
(h_config->execution_timeout - 2) * 1000000
|
uint32 limits to 4,294,967,295 which in seconds is 4294 seconds (~71 minutes which is 1 hour 11 minutes).
If the timeout value is more than this number, let's say: 120 minutes (7,200,000,000 microseconds) this wraps the timeout value around numeric_limits(uint32) which now becomes: 2905 seconds (48 minutes).
This unambiguous behaviour should be addressed, in a way that the timeout should be capped to the limit of uint32 instead of wrapping the timeout around.