Skip to content

PYTHON-1354: do not set timeout to None when calling execute_async in execute_concurrent - #972

Draft
mykaul wants to merge 1 commit into
scylladb:masterfrom
mykaul:fix/PYTHON-1354-concurrent-timeout
Draft

PYTHON-1354: do not set timeout to None when calling execute_async in execute_concurrent#972
mykaul wants to merge 1 commit into
scylladb:masterfrom
mykaul:fix/PYTHON-1354-concurrent-timeout

Conversation

@mykaul

@mykaul mykaul commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • Cherry-pick of apache/cassandra-python-driver@d0407ea0.
  • _ConcurrentExecutor._execute hardcoded timeout=None when calling execute_async, which disables the per-request timeout entirely instead of falling back to the request_timeout configured on the execution profile. This silently changes the timeout behavior for anyone using execute_concurrent/execute_concurrent_with_args.
  • Removes the timeout=None override so the execution profile's request_timeout is honored, matching the documented behavior of execute_async.

Test plan

  • Cherry-picked onto current master (conflicted with the local synchronous-errback recursion guard in cassandra/concurrent.py; resolved by keeping the local recursion-guard structure and only removing the timeout=None argument)
  • tests/unit/test_concurrent.py — 10/10 passed
  • tests/unit (excluding unrelated cython/column_encryption import errors caused by missing optional deps in this sandbox) — 749 passed, 40 skipped

…execute_concurrent

The default timeout=_NOT_SET will use the request_timeout specified in
the execution_profile. This is not the same as setting the timeout to
None. This will instead result in having no timeout which is not ideal.
If this behaviour really is wanted, the request_timeout can be set to
None in the execution_profile instead.

patch by osttra-h-jarrendal; reviewed by Bret McGuire and Brad Schoening
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

_ConcurrentExecutor._execute no longer passes timeout=None to session.execute_async. It continues to pass the statement, parameters, and execution profile.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing the timeout=None argument from execute_async in execute_concurrent.
Description check ✅ Passed The description explains the change, its reason, the cherry-pick resolution, and test results with relevant caveats.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
cassandra/concurrent.py-146-146 (1)

146-146: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a regression test for the timeout behavior.

Add a test that configures request_timeout and verifies that concurrent execution uses it. Also verify that explicitly passing timeout=None still disables timeouts.

As per coding guidelines: “Add relevant tests for new features and bug fixes.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cassandra/concurrent.py` at line 146, Add regression coverage for the
concurrent execution path around session.execute_async, configuring
request_timeout and asserting it is used when no per-call timeout is supplied.
Also assert that explicitly passing timeout=None disables the configured
timeout, preserving the existing override behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Other comments:
In `@cassandra/concurrent.py`:
- Line 146: Add regression coverage for the concurrent execution path around
session.execute_async, configuring request_timeout and asserting it is used when
no per-call timeout is supplied. Also assert that explicitly passing
timeout=None disables the configured timeout, preserving the existing override
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: f91697ba-197a-4309-a26d-edf063fb3919

📥 Commits

Reviewing files that changed from the base of the PR and between 1d7e601 and 637837d.

📒 Files selected for processing (1)
  • cassandra/concurrent.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants