Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
319c0345
Commit
319c0345
authored
Dec 19, 2017
by
Julien Duponchelle
Committed by
Yury Selivanov
Dec 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-29711: Fix stop_serving in proactor loop kill all listening servers (#431)
parent
36c2c044
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
Lib/asyncio/proactor_events.py
Lib/asyncio/proactor_events.py
+3
-1
Lib/test/test_asyncio/test_proactor_events.py
Lib/test/test_asyncio/test_proactor_events.py
+15
-4
Misc/NEWS.d/next/Library/2017-12-13-22-10-36.bpo-29711.hJjghA.rst
...S.d/next/Library/2017-12-13-22-10-36.bpo-29711.hJjghA.rst
+1
-0
No files found.
Lib/asyncio/proactor_events.py
View file @
319c0345
...
...
@@ -536,6 +536,8 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
self
.
_accept_futures
.
clear
()
def
_stop_serving
(
self
,
sock
):
self
.
_stop_accept_futures
()
future
=
self
.
_accept_futures
.
pop
(
sock
.
fileno
(),
None
)
if
future
:
future
.
cancel
()
self
.
_proactor
.
_stop_serving
(
sock
)
sock
.
close
()
Lib/test/test_asyncio/test_proactor_events.py
View file @
319c0345
...
...
@@ -567,10 +567,21 @@ class BaseProactorEventLoopTests(test_utils.TestCase):
self
.
assertTrue
(
self
.
sock
.
close
.
called
)
def
test_stop_serving
(
self
):
sock
=
mock
.
Mock
()
self
.
loop
.
_stop_serving
(
sock
)
self
.
assertTrue
(
sock
.
close
.
called
)
self
.
proactor
.
_stop_serving
.
assert_called_with
(
sock
)
sock1
=
mock
.
Mock
()
future1
=
mock
.
Mock
()
sock2
=
mock
.
Mock
()
future2
=
mock
.
Mock
()
self
.
loop
.
_accept_futures
=
{
sock1
.
fileno
():
future1
,
sock2
.
fileno
():
future2
}
self
.
loop
.
_stop_serving
(
sock1
)
self
.
assertTrue
(
sock1
.
close
.
called
)
self
.
assertTrue
(
future1
.
cancel
.
called
)
self
.
proactor
.
_stop_serving
.
assert_called_with
(
sock1
)
self
.
assertFalse
(
sock2
.
close
.
called
)
self
.
assertFalse
(
future2
.
cancel
.
called
)
if
__name__
==
'__main__'
:
...
...
Misc/NEWS.d/next/Library/2017-12-13-22-10-36.bpo-29711.hJjghA.rst
0 → 100644
View file @
319c0345
Fix ``stop_serving`` in asyncio proactor loop kill all listening servers
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment