Skip to content

fix: add read_timeout to connection pool config to respect STARROCKS_QUERY_TIMEOUT env var #35

Description

@Rupesh-kumar2

Summary

Fixes a bug where STARROCKS_QUERY_TIMEOUT environment variable was silently
ignored, causing long-running queries to fail with a ~30s timeout regardless
of what was configured.

Root Cause

The MySQL connector distinguishes between two types of timeouts:

Timeout Purpose Was Configurable?
connect_timeout Time to establish a connection ✅ Yes (via STARROCKS_CONNECTION_TIMEOUT)
read_timeout Time to wait for query results ❌ No — this PR fixes it

The STARROCKS_QUERY_TIMEOUT env var existed in documentation/configs
but was never wired into the connection pool, so the MySQL connector
fell back to its internal default (~30s), causing timeouts on analytical
queries over large datasets.

Fix

Add read_timeout to the connection pool config, reading from the
STARROCKS_QUERY_TIMEOUT environment variable:

'read_timeout': int(os.getenv('STARROCKS_QUERY_TIMEOUT', '600')),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions