smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
750 stars 139 forks source link

Long running no data query Timeout "Operation timed out" #221

Open gempir opened 3 months ago

gempir commented 3 months ago

I have a long running query. The query just copies data from 1 table into another table. So no data is actually transferred to the client and no data is being sent besides the initial query.

This can take longer than 5 minutes. This works fine in the normal builtin cpp clickhouse-client and finishes after ~10-20mins

But in this client that makes use of the http API I cannot get past 5 minutes.

In Statement.php line 190:

  [ClickHouseDB\Exception\QueryException (28)]
  Operation timed out after 300000 milliseconds with 0 bytes received

I have set every setting imaginable on the client.

        $this->clickhouseClient->setTimeout($timeoutSeconds);
        $this->clickhouseClient->setConnectTimeOut($timeoutSeconds);
        $this->clickhouseClient->settings()->max_execution_time($timeoutSeconds);
        $this->clickhouseClient->settings()->set('tcp_keep_alive_timeout', $timeoutSeconds);
        $this->clickhouseClient->settings()->set('send_timeout', $timeoutSeconds);
        $this->clickhouseClient->settings()->set('receive_timeout', $timeoutSeconds);
        $this->clickhouseClient->settings()->set('session_timeout', $timeoutSeconds);
        $this->clickhouseClient->write($query, $bindings);

Is there something I'm missing? Maybe some hard limit somewhere?

gempir commented 3 months ago

197 sounds similar but patching the client and trying it out with javascript does not seem to make a difference.

A normal curl cli calls works.