summaryrefslogtreecommitdiff
path: root/morphlib/exts
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-04-09 15:06:46 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-05-07 14:42:06 +0000
commite08f3e317dfa91e082506a0e89aca5c0d7af7380 (patch)
treea1226801403ced4a9b6a6abb2a9ba13a80ef76fd /morphlib/exts
parent75ef3e9585091b463b60d2981b3b7283a2ea8eab (diff)
downloadmorph-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 'morphlib/exts')
0 files changed, 0 insertions, 0 deletions