Mirror of mitogen
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Go to file
David Wilson 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().
6 years ago
.ci .ci: add verbiage for run_batches() too. 6 years ago
.github .github: add some more questions to issue template 6 years ago
ansible_mitogen ansible: quiesce boto logger; closes #541. 6 years ago
docs docs: more concise Changelog. 6 years ago
examples core: many docstring updates and an example substitute for Channel 6 years ago
mitogen issue #532: PushFileService race. 6 years ago
scripts misc: rename to scripts. tab completion!! 6 years ago
tests issue #532: PushFileService race. 6 years ago
.gitignore Add venvs/ to gitignore 6 years ago
.lgtm.yml compat: ignore LGTM checks on third party 7 years ago
.travis.yml issue #477: travis.yml typo. 6 years ago
LICENSE Update copyright year everywhere. 6 years ago
MANIFEST.in setup.py: include LICENSE; closes #538. 6 years ago
README.md Motivational shame badges back in README 6 years ago
dev_requirements.txt Split dev_requirements.txt up according to test mode. 6 years ago
preamble_size.py stable: fix preamble_size on stable docs. 6 years ago
run_tests Allow independant control of coverage erase and reporting 6 years ago
setup.cfg Ignore another annoying flake8 message. 7 years ago
setup.py Update copyright year everywhere. 6 years ago
tox.ini Aggregate code coverage data across tox all runs 6 years ago

README.md