Skip to content

fix: task cancellation from non-main thread#1306

Merged
rmshaffer merged 1 commit into
mainfrom
fix/issue-1305-cancel-without-future
Jun 25, 2026
Merged

fix: task cancellation from non-main thread#1306
rmshaffer merged 1 commit into
mainfrom
fix/issue-1305-cancel-without-future

Conversation

@rmshaffer

@rmshaffer rmshaffer commented Jun 25, 2026

Copy link
Copy Markdown
Member

Issue #, if available:
fixes #1305

Description of changes:
When cancelling a quantum task, there is no reason to create a future just to cancel it; and in fact this doesn't work on non-main threads (or even on main threads in Python 3.14 - although this is not officially supported yet) where there is no event loop.

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a1b1866) to head (b4e2a40).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1306   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          171       171           
  Lines        11404     11403    -1     
  Branches      1481      1481           
=========================================
- Hits         11404     11403    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rmshaffer rmshaffer marked this pull request as ready for review June 25, 2026 14:17
@rmshaffer rmshaffer requested a review from a team as a code owner June 25, 2026 14:17
@rmshaffer rmshaffer merged commit a9cc73a into main Jun 25, 2026
23 checks passed
@rmshaffer rmshaffer deleted the fix/issue-1305-cancel-without-future branch June 25, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempt to cancel a job raises error

2 participants