beeware / beeware/rubicon-objc
Clean up asyncio tasks after throwing an exception
- Dominant language
- Python
- Stars
- 301
- Forks
- 70
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 18
Description
**Is your feature request related to a problem? Please describe.**
"I'm always frustrated when" an async task raises an exception, due to a programming mistake, and then is never cleaned up.
For instance, the exception
```
unrecognized selector sent to instance 0xbdfcc9ec389956ee
Exception ignored on calling ctypes callback function:
```
results in every new attempt at launching an async task throwing an error:
```
RuntimeError: Cannot enter into task while
another task > is being executed.
```
**Describe the solution you'd like**
Would it be possible to somehow clean up the async timer event after an ObjC exception? I have no idea if this is even feasible and how to approach that. But it would certainly make the Cocoa event loop integration more robust.
Contributor guide
Research direction
Begin with the Cocoa event-loop integration and the async timer event implicated by the report. Reproduce the Objective-C exception and observe whether subsequent async-task launches fail with the reported RuntimeError. Done means the timer or task is cleaned up after the exception and later launches no longer fail.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c, python
- Domain
- desktop-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100