1
1

Merge pull request #2480 from rhc54/topic/sessiondir

Fix session directory cleanup
Этот коммит содержится в:
rhc54 2016-11-30 12:24:37 -08:00 коммит произвёл GitHub
родитель 15098161a3 9c596a6f54
Коммит b6647ce286

Просмотреть файл

@ -12,7 +12,7 @@
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2015 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2016 Intel, Inc. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -443,8 +443,6 @@ CLEANUP:
int
orte_session_dir_finalize(orte_process_name_t *proc)
{
int rc=ORTE_SUCCESS;
if (!orte_create_session_dirs || orte_process_info.rm_session_dirs ) {
/* we haven't created them or RM will clean them up for us*/
return ORTE_SUCCESS;
@ -458,14 +456,15 @@ orte_session_dir_finalize(orte_process_name_t *proc)
* accidentally removing directories we shouldn't
* touch
*/
rc = ORTE_ERR_NOT_INITIALIZED;
goto CLEANUP;
return ORTE_ERR_NOT_INITIALIZED;
}
opal_os_dirpath_destroy(orte_process_info.proc_session_dir,
false, orte_dir_check_file);
opal_os_dirpath_destroy(orte_process_info.job_session_dir,
false, orte_dir_check_file);
opal_os_dirpath_destroy(orte_process_info.jobfam_session_dir,
false, orte_dir_check_file);
if( NULL != orte_process_info.top_session_dir ){
opal_os_dirpath_destroy(orte_process_info.top_session_dir,
false, orte_dir_check_file);
@ -485,7 +484,6 @@ orte_session_dir_finalize(orte_process_name_t *proc)
opal_output(0, "sess_dir_finalize: proc session dir not empty - leaving");
}
}
goto CLEANUP;
}
if (opal_os_dirpath_is_empty(orte_process_info.job_session_dir)) {
@ -502,7 +500,22 @@ orte_session_dir_finalize(orte_process_name_t *proc)
opal_output(0, "sess_dir_finalize: job session dir not empty - leaving");
}
}
goto CLEANUP;
}
if (opal_os_dirpath_is_empty(orte_process_info.jobfam_session_dir)) {
if (orte_debug_flag) {
opal_output(0, "sess_dir_finalize: found jobfam session dir empty - deleting");
}
rmdir(orte_process_info.jobfam_session_dir);
} else {
if (orte_debug_flag) {
if (OPAL_ERR_NOT_FOUND ==
opal_os_dirpath_access(orte_process_info.jobfam_session_dir, 0)) {
opal_output(0, "sess_dir_finalize: jobfam session dir does not exist");
} else {
opal_output(0, "sess_dir_finalize: jobfam session dir not empty - leaving");
}
}
}
if(NULL != orte_process_info.top_session_dir) {
@ -523,8 +536,7 @@ orte_session_dir_finalize(orte_process_name_t *proc)
}
}
CLEANUP:
return rc;
return ORTE_SUCCESS;
}
static bool