Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When clearing a build directory fails on Windows (
shell.remove_directoryreturnsFalse),_handle_unrecoverable_error_on_windows()triggersutils.restart_machine()(shutdown /f /r /t 0) to recover from lingering file locks or disk issues, but previously returnedNoneimmediately while Windows initiated shutdown asynchronously.Returning normally caused two races during the few seconds before the OS terminated
run_bot.py:ack()of the failed task:_unpack_build/_unpack_builds/_unpack_custom_buildreturnedFalse, allowingcommands.process_command(task)to return without raising andPubSubTask.lease()to acknowledge the failed task message.task_loop()looped around and pulled/leased a new task right before the OS killed the bot process.Changes
build_manager._handle_unrecoverable_error_on_windows(): Sleep for 60s afterutils.restart_machine()while OS shutdown terminates the process, and callsys.exit(1)as a safety net if shutdown fails soPubSubTask.lease()unwinds viafinally:without acknowledging the failed task or leasing another one.utils.restart_machine(): Log an error if the OSshutdowncommand returns a non-zero exit code.build_manager_test.py: AddRegularBuildUnpackTest.test_unpack_build_windows_remove_directory_fails_restarts_and_exitscovering the Windows directory-cleanup failure path.