Skip to content

Update for race condition in Runner

Ben Martin requested to merge monkeyiq/odfserver:runner-race into master

I found that for some very short lived executions like uname and lsb commands sometimes the output was not being collected. Another trigger case for whatever reason was interacting with Google Docs.

The core logic behind this patch is that the Reader.run() method might discover that keepRunning() is false after sleeping and exit. There is nothing stopping more data from having come in while the sleep was happening, so we should really at least check if there are any last words so to speak before the Reader thread exits.

I've found that this helped out the Google Docs execution testing earlier today. It might be premature to say that it has crushed the bug, but the patch seems to make sense by the above logic.

This update might also be handy for runCommand in Tester.java in odfautotests.

Merge request reports