Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseEventLoop.close should shutdown executor before marking itself closed #72650

Closed
cmeyer mannequin opened this issue Oct 17, 2016 · 2 comments
Closed

BaseEventLoop.close should shutdown executor before marking itself closed #72650

cmeyer mannequin opened this issue Oct 17, 2016 · 2 comments
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@cmeyer
Copy link
Mannequin

cmeyer mannequin commented Oct 17, 2016

BPO 28464
Nosy @gvanrossum, @asvetlov, @1st1, @cmeyer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2022-03-12.17:05:57.580>
created_at = <Date 2016-10-17.21:54:11.652>
labels = ['type-bug', 'expert-asyncio']
title = 'BaseEventLoop.close should shutdown executor before marking itself closed'
updated_at = <Date 2022-03-12.17:05:57.579>
user = 'https://github.com/cmeyer'

bugs.python.org fields:

activity = <Date 2022-03-12.17:05:57.579>
actor = 'asvetlov'
assignee = 'none'
closed = True
closed_date = <Date 2022-03-12.17:05:57.580>
closer = 'asvetlov'
components = ['asyncio']
creation = <Date 2016-10-17.21:54:11.652>
creator = 'cmeyer'
dependencies = []
files = []
hgrepos = []
issue_num = 28464
keywords = []
message_count = 2.0
messages = ['278829', '415002']
nosy_count = 4.0
nosy_names = ['gvanrossum', 'asvetlov', 'yselivanov', 'cmeyer']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue28464'
versions = ['Python 3.5']

@cmeyer
Copy link
Mannequin Author

cmeyer mannequin commented Oct 17, 2016

BaseEventLoop.close shuts down the executor associated with the event loop.

It should do that BEFORE it sets self._closed = True, otherwise any pending executor futures will attempt to 'call_soon' on the event loop when they finish, resulting in a confusing error message that the event loop is already closed.

@cmeyer cmeyer mannequin added topic-asyncio type-bug An unexpected behavior, bug, or error labels Oct 17, 2016
@asvetlov
Copy link
Contributor

loop.shutdown_default_executor() exists for it, asyncio.run() calls the method

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant