YARN-4255. container-executor does not clean up docker operation command files. Contributed by Sidharta Seethana.

(cherry picked from commit da1ee078f9)
This commit is contained in:
Varun Vasudev 2015-10-14 15:25:21 +05:30
parent 0aeedfd572
commit 2dd9c475c4
2 changed files with 9 additions and 0 deletions

View File

@ -885,6 +885,9 @@ Release 2.8.0 - UNRELEASED
YARN-4253. Standardize on using PrivilegedOperationExecutor for all
invocations of container-executor in LinuxContainerExecutor. (Sidharta Seethana via vvasudev)
YARN-4255. container-executor does not clean up docker operation command files.
(Sidharta Seethana via vvasudev)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -1064,6 +1064,9 @@ int run_docker(const char *command_file) {
snprintf(docker_command_with_binary, EXECUTOR_PATH_MAX, "%s %s", docker_binary, docker_command);
char **args = extract_values_delim(docker_command_with_binary, " ");
//clean up command file before we exec
unlink(command_file);
int exit_code = -1;
if (execvp(docker_binary, args) != 0) {
fprintf(ERRORFILE, "Couldn't execute the container launch with args %s - %s",
@ -1360,6 +1363,9 @@ int launch_docker_container_as_user(const char * user, const char *app_id,
}
cleanup:
//clean up docker command file
unlink(command_file);
if (exit_code_file != NULL && write_exit_code_file(exit_code_file, exit_code) < 0) {
fprintf (ERRORFILE,
"Could not write exit code to file %s.\n", exit_code_file);