Aanand Prasad
7cfb5e7bc9
Fix race condition
...
If processing of all objects finishes before the queue is drained,
parallel_execute_iter() returns prematurely.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-11 17:05:52 +01:00
Aanand Prasad
15c5bc2e6c
Rename a couple of functions in parallel.py
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-11 13:05:30 +01:00
Aanand Prasad
0671b8b8c3
Document parallel helper functions
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-11 12:51:27 +01:00
Aanand Prasad
0e3db185cf
Small refactor to feed_queue()
...
Put the event tuple into the results queue rather than yielding it from
the function.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-11 12:37:00 +01:00
Aanand Prasad
be27e266da
Reduce queue timeout
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 19:07:40 +01:00
Aanand Prasad
5450a67c2d
Hold state in an object
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 19:06:07 +01:00
Aanand Prasad
54b6fc4219
Refactor so there's only one queue
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 18:54:02 +01:00
Aanand Prasad
af9526fb82
Move queue logic out of parallel_execute()
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 18:30:28 +01:00
Aanand Prasad
141b96bb31
Abort operations if their dependencies fail
...
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 17:51:09 +01:00
Aanand Prasad
bcdf541c8c
Refactor setup_queue()
...
- Stop sharing set objects across threads
- Use a second queue to signal when producer threads are done
- Use a single consumer thread to check dependencies and kick off new
producers
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2016-04-08 16:24:29 +01:00
Daniel Nephin
5c968f9e15
Fix flaky partial_change state test.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-21 19:07:50 -04:00
Ilya Skriblovsky
34de1f0a4c
Removed unused parallel.parallel_stop
...
Signed-off-by: Ilya Skriblovsky <IlyaSkriblovsky@gmail.com>
2016-03-14 22:56:58 +03:00
Ilya Skriblovsky
f933381a12
Dependency-ordered start/stop/up
...
Signed-off-by: Ilya Skriblovsky <IlyaSkriblovsky@gmail.com>
2016-03-14 22:55:42 +03:00
Daniel Nephin
ed4473c849
Fix signal handling with pyinstaller.
...
Raise a ShutdownException instead of a KeyboardInterupt when a thread.error
is caught. This thread.error is only raised when run from a pyinstaller
binary (for reasons unknown).
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-03-01 16:39:43 -05:00
Daniel Nephin
c64af0a459
Add an acceptance test and docs for the down subcommand
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-01-14 11:11:08 -05:00
Daniel Nephin
b4edf0c454
Move parallel_execute to a new module.
...
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-11-23 11:34:48 -05:00