twisted / twisted/twisted

Deferred object created from future returns wrong CancelledError type

Open
#9,679 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug core new priority-normal
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

Wiezzel's avatar @Wiezzel reported
Trac ID trac#9679
Type defect
Created 2019-07-25 10:29:20Z

Caller of Deferred.cancel() expects the cancelled deferred object to return twisted.internet.defer.CancelledError. On the other hand, calling Future.cancel() results in concurrent.futures.CancelledError. This causes problems with deferred objects created with Deferred.fromFuture(). E.g. setting timeout for such objects won't work because _cancelledToTimedOutError only traps twisted.internet.defer.CancelledError and not concurrent.futures.CancelledError.

Searchable metadata
trac-id__9679 9679
type__defect defect
reporter__Wiezzel Wiezzel
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__None None
time__1564050560892655 1564050560892655
changetime__1571186634740738 1571186634740738
version__None None
owner__Wiezzel Wiezzel

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Deferred.fromFuture and the _cancelledToTimedOutError path mentioned in the report. Find the existing Deferred cancellation and timeout tests, then verify that cancelling a Deferred created from a Future exposes twisted.internet.defer.CancelledError and that timeout handling still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.