Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
neoppod
Commits
b66c3fd3
Commit
b66c3fd3
authored
Jan 06, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qa: fix a race condition when using connection filters in threaded tests
parent
600cc94a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+8
-2
No files found.
neo/tests/threaded/__init__.py
View file @
b66c3fd3
...
@@ -484,7 +484,10 @@ class ConnectionFilter(object):
...
@@ -484,7 +484,10 @@ class ConnectionFilter(object):
else
:
else
:
return
cls
.
_addPacket
(
conn
,
packet
)
return
cls
.
_addPacket
(
conn
,
packet
)
cls
.
filter_queue
[
conn
]
=
queue
=
deque
()
cls
.
filter_queue
[
conn
]
=
queue
=
deque
()
p
=
packet
.
__new__
(
packet
.
__class__
)
p
=
packet
.
__class__
logging
.
debug
(
"queued %s#0x%04x for %s"
,
p
.
__name__
,
packet
.
getId
(),
conn
)
p
=
packet
.
__new__
(
p
)
p
.
__dict__
.
update
(
packet
.
__dict__
)
p
.
__dict__
.
update
(
packet
.
__dict__
)
queue
.
append
(
p
)
queue
.
append
(
p
)
Connection
.
_addPacket
=
_addPacket
Connection
.
_addPacket
=
_addPacket
...
@@ -520,7 +523,10 @@ class ConnectionFilter(object):
...
@@ -520,7 +523,10 @@ class ConnectionFilter(object):
else
:
else
:
if
conn
.
isClosed
():
if
conn
.
isClosed
():
return
return
cls
.
_addPacket
(
conn
,
packet
)
# Use the thread that created the packet to reinject it,
# to avoid a race condition on Connector.queued.
conn
.
em
.
wakeup
(
lambda
conn
=
conn
,
packet
=
packet
:
conn
.
isClosed
()
or
cls
.
_addPacket
(
conn
,
packet
))
continue
continue
break
break
else
:
else
:
...
...
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