diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-04-09 15:06:46 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-07 14:42:06 +0000 |
commit | e08f3e317dfa91e082506a0e89aca5c0d7af7380 (patch) | |
tree | a1226801403ced4a9b6a6abb2a9ba13a80ef76fd /morphcacheserver | |
parent | 75ef3e9585091b463b60d2981b3b7283a2ea8eab (diff) | |
download | morph-e08f3e317dfa91e082506a0e89aca5c0d7af7380.tar.gz |
distbuild: Allow WorkerConnection to track multiple in-flight jobs
Although in theory a worker should only ever have one job at once, in
practice this assumption doesn't hold, and can cause serious confusion.
The worker (implemented in the JsonRouter class) will actually queue up
exec-request messages and run the oldest one first. I saw a case where,
due to a build not being correctly cancelled, the
WorkerConnection.current_job attribute got out of sync with what the
worker was actually building. This lead to an error when trying to fetch
the built artifacts, as the controller tried to fetch artifacts for
something that wasn't actually built yet, and everything got stuck.
To prevent this from happening, we either need to remove the
exec-request queue in the worker-daemon process, or make the
WorkerConnection class cope with multiple jobs at once. The latter seems
like the more robust approach, so I have done that.
Another bug this fixes is the issue where, if the 'Computing build
graph' (serialise-artifact) step of a build completes on the controller
while one of its WorkerConnection objects is waiting for artifacts to
be fetched by the shared cache from the worker, the build hangs. This
would happen because the WorkerConnection assumed that any
HelperResponse message it saw was the result of its request, so would
send a _JobFinished before caching had actually finished if there was
an unrelated HelperResponse received in the meantime. It now checks
the request ID of the HelperResponse before calling the code that is
now in the new _handle_helper_result_for_job() function.
Change-Id: Ia961f333f9dae77405b58c82c99a56e4c43e1628
Diffstat (limited to 'morphcacheserver')
0 files changed, 0 insertions, 0 deletions