Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
d6079a4a
Commit
d6079a4a
authored
May 18, 2015
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #559 from gevent/ajdavis_issue_349_r
Fix #349: threaded resolver hangs due to import lock
parents
6fe12a79
b8826b7a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
gevent/resolver_thread.py
gevent/resolver_thread.py
+5
-1
greentest/getaddrinfo_module.py
greentest/getaddrinfo_module.py
+4
-0
greentest/test__getaddrinfo_import.py
greentest/test__getaddrinfo_import.py
+7
-0
No files found.
gevent/resolver_thread.py
View file @
d6079a4a
# Copyright (c) 2012 Denis Bilenko. See LICENSE for details.
import
_socket
from
gevent.hub
import
get_hub
from
gevent.hub
import
get_hub
,
text_type
__all__
=
[
'Resolver'
]
# trigger import of encodings.idna to avoid https://github.com/gevent/gevent/issues/349
text_type
(
'foo'
).
encode
(
'idna'
)
class
Resolver
(
object
):
expected_errors
=
Exception
...
...
greentest/getaddrinfo_module.py
0 → 100644
View file @
d6079a4a
import
socket
import
gevent.socket
as
gevent_socket
gevent_socket
.
getaddrinfo
(
u'gevent.org'
,
None
,
socket
.
AF_INET
)
greentest/test__getaddrinfo_import.py
0 → 100644
View file @
d6079a4a
# a deadlock is possible if we import a module that runs Gevent's getaddrinfo
# with a unicode hostname, which starts Python's getaddrinfo on a thread, which
# attempts to import encodings.idna but blocks on the import lock. verify
# that Gevent avoids this deadlock.
import
getaddrinfo_module
del
getaddrinfo_module
# fix pyflakes
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