Skip to content

Commit 81ece1b

Browse files
committed
exclusive_host_usage test failed due to usufficient host slots, further cleanup
1 parent 2a8c2da commit 81ece1b

File tree

3 files changed

+58
-15
lines changed

3 files changed

+58
-15
lines changed

src/checktree/functional/exclusive_host_usage/check.exp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ lappend check_functions "exclusive_job_consumables"
7474
proc exclusive_host_usage_setup {} {
7575
global ts_config CHECK_FIRST_FOREIGN_SYSTEM_USER
7676
global exclusive_hosts
77-
global exclusive_host_usage_complex_backup
77+
global exclusive_host_usage_complex_backup exclusive_host_usage_host_backup
7878

7979
if {$ts_config(source_dir) == "none"} {
8080
ts_log_config "source directory is set to \"none\" - cannot run test"
@@ -92,9 +92,19 @@ proc exclusive_host_usage_setup {} {
9292
set_complex tmp_complex
9393

9494
# set host complex attributes
95-
set host_config(complex_values) "excl=true,jexcl=true"
96-
set_exechost host_config [lindex $exclusive_hosts 0]
97-
set_exechost host_config [lindex $exclusive_hosts 1]
95+
set hosts [concat [lindex $exclusive_hosts 0] [lindex $exclusive_hosts 1]]
96+
foreach host $hosts {
97+
# backup existing complex values
98+
get_exechost eh_backup $host
99+
set exclusive_host_usage_host_backup($host) $eh_backup(complex_values)
100+
101+
# set new ones
102+
add_or_replace_array_param host_config exclusive_host_usage_host_backup "complex_values" "excl" "true"
103+
add_or_replace_array_param host_config host_config "complex_values" "jexcl" "true"
104+
set_exechost host_config $host
105+
}
106+
# beginning with 9.1.0 we need to increase slots on host level
107+
setup_host_slots_for_binding $hosts
98108

99109
# add pes
100110
set pe(slots) "100"
@@ -128,7 +138,7 @@ proc exclusive_host_usage_setup {} {
128138

129139
proc exclusive_host_usage_cleanup {} {
130140
global ts_config
131-
global exclusive_host_usage_complex_backup
141+
global exclusive_host_usage_complex_backup exclusive_host_usage_host_backup
132142
global exclusive_hosts
133143

134144
delete_all_jobs
@@ -147,21 +157,16 @@ proc exclusive_host_usage_cleanup {} {
147157
del_pe "round_robin"
148158
del_pe "fill_up"
149159

150-
# remove host complex attributes
151-
set host_config(complex_values) "NONE"
152-
set_exechost host_config [lindex $exclusive_hosts 0]
153-
set_exechost host_config [lindex $exclusive_hosts 1]
160+
# restore exec hosts
161+
cleanup_host_slots_for_binding
162+
host_restore_complex_values exclusive_host_usage_host_backup
154163

155164
# remove exclusive complex
156165
reset_complex exclusive_host_usage_complex_backup
157166
unset exclusive_host_usage_complex_backup
158167

159168
# unset our test's global variables
160-
foreach var "exclusive_hosts" {
161-
if {[info exists $var]} {
162-
unset $var
163-
}
164-
}
169+
unset -nocomplain exclusive_hosts exclusive_host_usage_complex_backup exclusive_host_usage_host_backup
165170
}
166171

167172
proc do_exclusive_usage_test { first_is_exclusive {pe_name ""} {rqs_test 0} } {

src/tcl_files/sge_host.tcl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,3 +945,41 @@ proc get_shell_fd_limit_for_host { host user {mode "soft"} } {
945945
return $ret_val
946946
}
947947

948+
##
949+
# @brief Backup complex_values of a list of hosts
950+
#
951+
# This procedure backs up the complex_values attribute of a list of hosts.
952+
# The backup is stored in an associative array passed as argument,
953+
# where the host names are the keys and the complex_values are the values.
954+
#
955+
# @param hostlist List of hosts
956+
# @param backup_var Name of array variable to store the backup
957+
# @see host_restore_complex_values
958+
proc host_backup_complex_values {hostlist backup_var} {
959+
upvar $backup_var backup
960+
961+
foreach host $hostlist {
962+
get_exechost eh_backup $host
963+
set backup($host) $eh_backup(complex_values)
964+
}
965+
}
966+
967+
##
968+
# @brief Restore complex_values of a list of hosts from backup
969+
#
970+
# The function expects an associative array as argument,
971+
# where the host names are the keys and the complex_values are the values.
972+
# It restores the complex_values attribute of each host.
973+
#
974+
# @param backup_var Name of array variable containing the backup
975+
# @see host_backup_complex_values
976+
proc host_restore_complex_values {backup_var} {
977+
upvar $backup_var backup
978+
979+
foreach host [array names backup] {
980+
unset -nocomplain eh_restore
981+
set eh_restore(complex_values) $backup($host)
982+
set_exechost eh_restore $host
983+
}
984+
}
985+

src/tcl_files/sge_procedures.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3600,7 +3600,7 @@ proc shutdown_execd {host_list {soft 0} {timeout 120}} {
36003600
}
36013601
set result [start_sge_bin "qconf" "$option $host" $ts_config(master_host) $CHECK_USER]
36023602
if {$prg_exit_state != 0} {
3603-
ts_log_fine "qconf -ke $host returned $prg_exit_state, hard killing execd"
3603+
ts_log_fine "qconf -ke $host returned $prg_exit_state, hard killing execd:\n$result"
36043604
shutdown_system_daemon $host execd
36053605
}
36063606
}

0 commit comments

Comments
 (0)