Can't set client timeout (AER-4344)

i m setting timeouts aerospike.connect_timeout 10000 aerospike.read_timeout 10000 aerospike.write_timeout 10000 in php.ini but when executing UDF from client it shows error Client timeout: timeout=1000 iterations=1 failedNodes=0 failedConns=0

please tell me how to set read timeout etc.

Hi Manjeet,

Can you show a snippet of the code that is exhibiting this?

Thanks.

$where = Aerospike::predicateBetween(ā€œtimeStampā€, $last30Days, $today); $results = array(); $response = array(); $agg_status = $db->aggregate(ā€œnamespaceā€, ā€œsetā€, $where, ā€œgetTotalSummaryā€, ā€œentry_functionā€, array($today,$yesterDay,$last7Days,$last30Days,ā€œMā€,1), $results ); echo $db->error(); if($agg_status == Aerospike::OK){

        foreach($results['bins'] as $key=>$value){
            $response[] = $value;
        }
        $db->close();
        return $response;
    }

    $db->close();
    return array("status"=>0);

and php.ini snippet already shown.

extension=aerospike.so aerospike.udf.lua_system_path=/opt/aerospike/client-php/sys-lua aerospike.udf.lua_user_path=/opt/aerospike/client-php/usr-lua aerospike.connect_timeout 6000000 aerospike.read_timeout 6000000 aerospike.write_timeout 6000000 this is my php.ini snippet for aerospike

Weā€™re looking into the problem. The goal would be to roll out a solution with the next release (3.3.13).

2 Likes

Hi there. Can you confirm if this was fixed as Iā€™m having the same issue. Below is my ext-aerospike.ini file which is loaded with PHP. If I run php -i | grep aero i get the following:

Additional .ini files parsed => /usr/local/etc/php/5.5/conf.d/ext-aerospike.ini,
aerospike
aerospike support => enabled
aerospike version => 3.0
Registered save handlers => files user redis aerospike

So it shows that Aerospike is installed and running etc. My ext-aerospike.ini file contains the following:

extension=aerospike.so
aerospike.udf.lua_system_path=/usr/local/aerospike/client-php/sys-lua
aerospike.udf.lua_user_path=/usr/local/aerospike/client-php/usr-lua
aerospike.read_timeout 10000

But if I try to run a query, I get the following:

An error occured while querying [9] Client timeout: timeout=1000 iterations=1 failedNodes=0 failedConns=0

any ideas on what may be causing the issue, or any other way I can set the timeout on this? Iā€™m pretty new to Aerospike so not sure where to look from here on.

Many thanks

Maybe itā€™s been copied over wrong, but there should be an equals sign in this config directive: aerospike.read_timeout=10000

Try again, if that was in fact a typo, please.

Ahhhh, perfect - thanks rbotzer - working fine now. One thing that is strange however is I also tried changing the timeout options by using Aerospike::OPT_READ_TIMEOUT => 12500 within my options array when connecting to the DB but this didnā€™t seem to have any effect. Again, is there something Iā€™m doing wrong in terms of that?

Full connection code:

$opts = array(
Aerospike::OPT_CONNECT_TIMEOUT => 12500,
Aerospike::OPT_READ_TIMEOUT => 12500,
Aerospike::OPT_WRITE_TIMEOUT => 15000
);
$this->setDb(new Aerospike($this->getConfig(), true, $opts));

Many thanks

This seems to be a bug. There is a configuration ā€˜inheritanceā€™ model, where

default values < config file values < constructor values < call value

So with a php.ini setting to 10000 and constructor value set to 12500, I expect the timeout to be 12500. If you passed a different value in the get() call, I expect that one to apply for the call. Please open a new issue in aerospike/aerospike-client-php.

By the way, 12.5s for timeout seems exceedingly huge. Is there a good reason for this?

Hey rbotzer - thanks for the feedback - Iā€™ll submit an issue now detailing the bug.

I was only using 12.5s as a timeout for testing - just to ensure that the value was being passed form the relevant place etc, in reality itā€™s no where near that high but it helped me debug the issue.

Thanks again

Internally this is being tracked via JIRA ticket AER-4344.

This issue, AKA CLIENT-88, is fixed in release 3.4.3.