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

[Windows] asyncio: race condition related to IocpProactor.connect_pipe() #67482

Closed
vstinner opened this issue Jan 21, 2015 · 5 comments
Closed

Comments

@vstinner
Copy link
Member

BPO 23293
Nosy @gvanrossum, @vstinner, @tjguk, @zware, @1st1, @zooba

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 2015-01-22.22:05:44.560>
created_at = <Date 2015-01-21.22:32:53.429>
labels = ['OS-windows', 'expert-asyncio']
title = '[Windows] asyncio: race condition related to IocpProactor.connect_pipe()'
updated_at = <Date 2015-01-26.14:05:24.626>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2015-01-26.14:05:24.626>
actor = 'python-dev'
assignee = 'none'
closed = True
closed_date = <Date 2015-01-22.22:05:44.560>
closer = 'vstinner'
components = ['Windows', 'asyncio']
creation = <Date 2015-01-21.22:32:53.429>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 23293
keywords = []
message_count = 5.0
messages = ['234448', '234515', '234517', '234727', '234744']
nosy_count = 7.0
nosy_names = ['gvanrossum', 'vstinner', 'tim.golden', 'python-dev', 'zach.ware', 'yselivanov', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue23293'
versions = ['Python 3.4', 'Python 3.5']

@vstinner
Copy link
Member Author

Currently, IocpProactor.connect_pipe() is implemented with QueueUserWorkItem() which starts a thread that cannot be interrupted. Because of that, this function requires special cases in _register() and close() methods of IocpProactor.

While fixing the issue bpo-23095, I saw that IocpProactor.connect_pipe() causes "GetQueuedCompletionStatus() returned an unexpected event" messages to be logged, but also to hang the test suite.

I propose a solution to reimplement IocpProactor.connect_pipe() without a thread:
https://code.google.com/p/tulip/issues/detail?id=197

It should fix this issue.

@vstinner vstinner changed the title [Windows] asyncio: race condition related in IocpProactor.connect_pipe() [Windows] asyncio: race condition related to IocpProactor.connect_pipe() Jan 21, 2015
@python-dev
Copy link
Mannequin

python-dev mannequin commented Jan 22, 2015

New changeset 1e3a1af0705f by Victor Stinner in branch '3.4':
Issue bpo-23293, asyncio: Rewrite IocpProactor.connect_pipe()
https://hg.python.org/cpython/rev/1e3a1af0705f

@vstinner
Copy link
Member Author

Issue fixed: IocpProactor.connect_pipe() doesn't use "blocking" operations anymore, it's now implemented as polling with non blocking operations.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jan 26, 2015

New changeset b6ab8fe16d16 by Victor Stinner in branch '3.4':
Issue bpo-23293, asyncio: Cleanup IocpProactor.close()
https://hg.python.org/cpython/rev/b6ab8fe16d16

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jan 26, 2015

New changeset 99c3e304a4ea by Victor Stinner in branch '3.4':
Issue bpo-23293, asyncio: Rewrite IocpProactor.connect_pipe() as a coroutine
https://hg.python.org/cpython/rev/99c3e304a4ea

@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
Projects
None yet
Development

No branches or pull requests

1 participant