TFTP file download should be synchronous and handle errors
The TFTP file download feature currently spawns wget in the background, so offers no tracking of progress or download errors.
It should perform downloads as a synchronous operation, which will allow us to report success or failure back to Foreman when provisioning hosts. Async downloads also mean that Foreman often boots VMs up too quickly, before the boot files have downloaded.
wget has another issue under failure, as it leaves a zero byte file in place which means we think downloads were a success.
Given the proxy's usually deployed on WEBrick, a synchronous download could tie up its resources, making it inaccessible to others though.
#11 Updated by Lukas Zapletal almost 3 years ago
When touching this code, consider downloading the files under different (temporary) names so we shorten the window when different host (not the one being blocked by the download) sees incorrect file (e.g. during upgrading to newer version).
Also I would like to keep the current (asynchronous) behavior in some way so it can be used when we implement #5121
I am currently working on an issue when file was downloaded incorrectly (error during transmission) and wget is not able to fix this anymore since it only compares timestamps. If you can take this into consideration when designing the new way of downloading.