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
60cc6b0f
Commit
60cc6b0f
authored
Dec 17, 2020
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Looks like a memory-fence type issue on PyPy on Win.
Try killing the pool to see if that buys us what we need.
parent
5a05e824
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
src/gevent/tests/test__threadpool.py
src/gevent/tests/test__threadpool.py
+13
-1
src/gevent/threadpool.py
src/gevent/threadpool.py
+1
-1
No files found.
src/gevent/tests/test__threadpool.py
View file @
60cc6b0f
...
...
@@ -786,9 +786,11 @@ class TestWorkerProfileAndTrace(TestCase):
self
.
ClassUnderTest
=
Pool
pool
=
self
.
_makeOne
(
1
)
pool
=
self
.
_makeOne
(
1
,
create_all_worker_threads
=
True
)
assert
isinstance
(
pool
,
Pool
)
# Do this after creating the pool and its thread to verify we don't
# capture the function at thread creation time.
setter
(
callback
)
...
...
@@ -796,6 +798,16 @@ class TestWorkerProfileAndTrace(TestCase):
self
.
assertEqual
(
res
,
1701
)
self
.
assertGreaterEqual
(
called
[
0
],
1
)
# Shutdown the pool. PyPy2.7-7.3.1 on Windows/Appveyor was
# properly seeing the before_task value, but after_task was empty.
# That suggested a memory consistency type issue, where the updates
# written by the other thread weren't fully visible to this thread
# yet. Try to kill it to see if that helps. (Couldn't reproduce
# on macOS).
#
# https://ci.appveyor.com/project/jamadden/gevent/build/job/wo9likk85cduui7n#L867
pool
.
kill
()
# The function is active only for the scope of the function
self
.
assertEqual
(
before_task
,
[
task
,
None
,
callback
])
self
.
assertEqual
(
after_task
,
[
task
,
callback
,
None
])
...
...
src/gevent/threadpool.py
View file @
60cc6b0f
...
...
@@ -460,7 +460,7 @@ class ThreadPool(GroupMappingMixin):
self
.
fork_watcher
.
stop
()
def
_adjust_wait
(
self
):
delay
=
0.0001
delay
=
self
.
hub
.
loop
.
approx_timer_resolution
while
True
:
self
.
_adjust_step
()
if
len
(
self
.
_worker_greenlets
)
<=
self
.
_maxsize
:
...
...
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