Updated anvil-daemon's new job launching logic to allow the restart of a running job that failed out early.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 2 years ago
parent cc15eca6fb
commit 156a0ca201
  1. 1
      Anvil/Tools.pm
  2. 1
      share/words.xml
  3. 17
      tools/anvil-daemon
  4. 2
      tools/anvil-watch-power

@ -1095,6 +1095,7 @@ sub _set_paths
bonds => "/proc/net/bonding", bonds => "/proc/net/bonding",
'cgi-bin' => "/var/www/cgi-bin", 'cgi-bin' => "/var/www/cgi-bin",
drbd_resources => "/etc/drbd.d/", drbd_resources => "/etc/drbd.d/",
drbd_kernel_proc => "/sys/kernel/debug/drbd/resources",
fence_agents => "/usr/sbin", fence_agents => "/usr/sbin",
firewalld_services => "/usr/lib/firewalld/services", firewalld_services => "/usr/lib/firewalld/services",
firewalld_zones_etc => "/etc/firewalld/zones", # Changes when firewall-cmd ... --permanent is used. firewalld_zones_etc => "/etc/firewalld/zones", # Changes when firewall-cmd ... --permanent is used.

@ -2393,6 +2393,7 @@ The file: [#!variable!file!#] needs to be updated. The difference is:
<key name="log_0739">The server: [#!variable!server!#] needs it's pacemaker configuration updated. Running: [#!variable!command!#].</key> <key name="log_0739">The server: [#!variable!server!#] needs it's pacemaker configuration updated. Running: [#!variable!command!#].</key>
<key name="log_0740">Running the scan-agent: [#!variable!agent!#] now to ensure that the database has an updated view of resources.</key> <key name="log_0740">Running the scan-agent: [#!variable!agent!#] now to ensure that the database has an updated view of resources.</key>
<key name="log_0741">I was about to start: [#!variable!command!#] with the job UUID: [#!variable!this_job_uuid!#]. However, another job using the same command with the job UUID: [#!variable!other_job_uuid!#]. To avoid race conditions, only one process with a given command is run at the same time.</key> <key name="log_0741">I was about to start: [#!variable!command!#] with the job UUID: [#!variable!this_job_uuid!#]. However, another job using the same command with the job UUID: [#!variable!other_job_uuid!#]. To avoid race conditions, only one process with a given command is run at the same time.</key>
<key name="log_0742">The job with the command: [#!variable!command!#] and job UUID: [#!variable!job_uuid!#] is restarting.</key>
<!-- Messages for users (less technical than log entries), though sometimes used for logs, too. --> <!-- Messages for users (less technical than log entries), though sometimes used for logs, too. -->
<key name="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key> <key name="message_0001">The host name: [#!variable!target!#] does not resolve to an IP address.</key>

@ -1637,7 +1637,22 @@ sub run_jobs
if (exists $anvil->data->{jobs}{running}{$started_job_uuid}) if (exists $anvil->data->{jobs}{running}{$started_job_uuid})
{ {
if ($anvil->data->{jobs}{running}{$started_job_uuid}{job_progress} != 100) # If the previously running job and this job have the same
# UUID, it failed and needs to restart.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
job_uuid => $job_uuid,
started_job_uuid => $started_job_uuid,
"jobs::running::${started_job_uuid}::job_progress" => $anvil->data->{jobs}{running}{$started_job_uuid}{job_progress},
}});
if ($started_job_uuid eq $job_uuid)
{
# We're restarting.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0741", variables => {
command => $job_command,
job_uuid => $job_uuid,
}});
}
elsif ($anvil->data->{jobs}{running}{$started_job_uuid}{job_progress} != 100)
{ {
# Don't start it in this pass. # Don't start it in this pass.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0741", variables => { $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0741", variables => {

@ -52,6 +52,8 @@ while(1)
sleep 2; sleep 2;
} }
$anvil->nice_exit({exit_code => 0});
sub show_power_data sub show_power_data
{ {

Loading…
Cancel
Save