Deferred object created from future returns wrong CancelledError type
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 10
Description
| @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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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