master
docs-master
stable
pr683
0.2-release
pull-request-checklist
dmw
circleci-project-setup
new-serialization
gh-pages
redirect
issue531
issue510
issue260
issue72
wip-fakessh-exit-status
v0.2.10rc1
v0.3.0rc1
v0.2.9
v0.2.8
v0.2.7
v0.2.6
v0.2.5
v0.2.4
v0.2.3
working-django
working
v0.2.0
v0.2.1
v0.2.10
v0.2.10-rc.0
v0.2.2
v0.3.0
v0.3.0-rc.0
v0.3.1
v0.3.10
v0.3.11
v0.3.12
v0.3.13
v0.3.14
v0.3.15
v0.3.16
v0.3.17
v0.3.18
v0.3.19
v0.3.2
v0.3.20
v0.3.21
v0.3.22
v0.3.23
v0.3.24
v0.3.25
v0.3.25a1
v0.3.25a2
v0.3.25a3
v0.3.25b1
v0.3.26
v0.3.27
v0.3.28
v0.3.29
v0.3.3
v0.3.30
v0.3.31
v0.3.32
v0.3.33
v0.3.34
v0.3.35
v0.3.4
v0.3.5
v0.3.6
v0.3.7
v0.3.8
v0.3.9
${ noResults }
1 Commits (36f3e3b28c82611c72a867cdc1f5ddc8bd9325e9)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
d4c0250083 |
issue #532: PushFileService race.
There has always been a race in PushFileService since given a parent
asked to forward modules to two children via some intermediary:
interm = router.local()
c1 = router.local(via=interm)
c2 = router.local(via=interm)
service.propagate_to(c1, 'foo/bar.py')
service.propagate_to(c2, 'foo/bar.py')
Two calls will be emitted to 'interm':
PushFileService.store_and_forward(c1, 'foo/bar.py', [blob])
PushFileService.store(c2, 'foo/bar.py')
Which will be processed in-order up to the point where service pool
threads in 'interm' are woken to process the message.
While it is guaranteed store_and_forward() will be processed first, no
guarantee existed that its assigned pool thread would wake and take
_lock first, thus it was possible for forward() to win the race, and for
a request to arrive to forward a file that had not been placed in local
cache yet.
Here we get rid of SerializedInvoker entirely, as it is partially to
blame for hiding the race: SerializedInvoker can only ensure no two
messages are processed simultaneously, it cannot ensure the messages are
processed in their intended order.
Instead, teach forward() that it may be called before
store_and_forward(), and if that is the case, to place the forward
request on to _waiters alongside any local threads blocked in get().
|
7 years ago |