[pve-devel] [PATCH ha-manager 10/13] Log timeout parameter as well

Fabian Ebner f.ebner at proxmox.com
Thu Sep 26 13:38:56 CEST 2019


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

I thought that logging the timeout parameter might be useful,
since it is readily available and since it is used for
the shutdown/stop distinction.

 src/PVE/HA/LRM.pm                          |  2 +-
 src/test/test-cfs-unavailable1/log.expect  |  2 +-
 src/test/test-cfs-unavailable2/log.expect  |  2 +-
 src/test/test-reboot1/log.expect           |  2 +-
 src/test/test-resource-failure4/log.expect | 10 +++++-----
 src/test/test-service-command1/log.expect  |  2 +-
 src/test/test-shutdown-policy1/log.expect  |  2 +-
 src/test/test-shutdown-policy2/log.expect  |  2 +-
 src/test/test-shutdown1/log.expect         |  2 +-
 src/test/test-shutdown2/log.expect         |  2 +-
 src/test/test-shutdown3/log.expect         |  2 +-
 src/test/test-shutdown4/log.expect         |  2 +-
 12 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm
index 7002ddd..4e9a957 100644
--- a/src/PVE/HA/LRM.pm
+++ b/src/PVE/HA/LRM.pm
@@ -776,7 +776,7 @@ sub exec_resource_agent {
 
 	my $timeout = $params->{timeout} // 60;
 
-	$haenv->log("info", "stopping service $sid");
+	$haenv->log("info", "stopping service $sid (timeout=$timeout)");
 
 	$plugin->shutdown($haenv, $id, $timeout);
 
diff --git a/src/test/test-cfs-unavailable1/log.expect b/src/test/test-cfs-unavailable1/log.expect
index d45afb3..cc96b2a 100644
--- a/src/test/test-cfs-unavailable1/log.expect
+++ b/src/test/test-cfs-unavailable1/log.expect
@@ -53,7 +53,7 @@ err     201    node1/lrm: updating service status from manager failed: cfs conne
 err     201    node1/lrm: unable to write lrm status file - cfs connection refused - not mounted?
 info    220      cmdlist: execute cfs node1 rw work
 info    220    node1/crm: service 'vm:101': state changed from 'started' to 'request_stop'
-info    221    node1/lrm: stopping service vm:101
+info    221    node1/lrm: stopping service vm:101 (timeout=60)
 info    221    node1/lrm: service status vm:101 stopped
 info    240    node1/crm: service 'vm:101': state changed from 'request_stop' to 'stopped'
 info    820     hardware: exit simulation - done
diff --git a/src/test/test-cfs-unavailable2/log.expect b/src/test/test-cfs-unavailable2/log.expect
index f1bbdb0..da8ce1a 100644
--- a/src/test/test-cfs-unavailable2/log.expect
+++ b/src/test/test-cfs-unavailable2/log.expect
@@ -43,7 +43,7 @@ noti    200    node1/crm: temporary inconsistent cluster state (cfs restart?), s
 noti    201    node1/lrm: temporary inconsistent cluster state (cfs restart?), skip round
 info    220      cmdlist: execute cfs node1 update work
 info    220    node1/crm: service 'vm:101': state changed from 'started' to 'request_stop'
-info    221    node1/lrm: stopping service vm:101
+info    221    node1/lrm: stopping service vm:101 (timeout=60)
 info    221    node1/lrm: service status vm:101 stopped
 info    240    node1/crm: service 'vm:101': state changed from 'request_stop' to 'stopped'
 info    820     hardware: exit simulation - done
diff --git a/src/test/test-reboot1/log.expect b/src/test/test-reboot1/log.expect
index d99a752..1fb89d8 100644
--- a/src/test/test-reboot1/log.expect
+++ b/src/test/test-reboot1/log.expect
@@ -24,7 +24,7 @@ info    120      cmdlist: execute reboot node3
 info    120    node3/lrm: got shutdown request with shutdown policy 'conditional'
 info    120    node3/lrm: reboot LRM, stop and freeze all services
 info    120    node1/crm: service 'vm:103': state changed from 'started' to 'freeze'
-info    125    node3/lrm: stopping service vm:103
+info    125    node3/lrm: stopping service vm:103 (timeout=60)
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126       reboot: execute crm node3 stop
diff --git a/src/test/test-resource-failure4/log.expect b/src/test/test-resource-failure4/log.expect
index 77c2367..ff82434 100644
--- a/src/test/test-resource-failure4/log.expect
+++ b/src/test/test-resource-failure4/log.expect
@@ -22,18 +22,18 @@ info     25    node3/lrm: starting service fa:1001
 info     25    node3/lrm: service status fa:1001 started
 info    120      cmdlist: execute service fa:1001 disabled
 info    120    node1/crm: service 'fa:1001': state changed from 'started' to 'request_stop'
-info    125    node3/lrm: stopping service fa:1001
+info    125    node3/lrm: stopping service fa:1001 (timeout=60)
 info    125    node3/lrm: unable to stop stop service fa:1001 (still running)
 err     140    node1/crm: service 'fa:1001' stop failed (exit code 1)
 info    140    node1/crm: service 'fa:1001': state changed from 'request_stop' to 'error'
 info    140    node1/crm: service 'fa:1001': state changed from 'error' to 'stopped'
-info    145    node3/lrm: stopping service fa:1001
+info    145    node3/lrm: stopping service fa:1001 (timeout=60)
 info    145    node3/lrm: unable to stop stop service fa:1001 (still running)
-info    165    node3/lrm: stopping service fa:1001
+info    165    node3/lrm: stopping service fa:1001 (timeout=60)
 info    165    node3/lrm: unable to stop stop service fa:1001 (still running)
-info    185    node3/lrm: stopping service fa:1001
+info    185    node3/lrm: stopping service fa:1001 (timeout=60)
 info    185    node3/lrm: unable to stop stop service fa:1001 (still running)
-info    205    node3/lrm: stopping service fa:1001
+info    205    node3/lrm: stopping service fa:1001 (timeout=60)
 info    205    node3/lrm: unable to stop stop service fa:1001 (still running)
 info    220      cmdlist: execute service fa:1001 delete
 info    220    node1/crm: removing stale service 'fa:1001' (no config)
diff --git a/src/test/test-service-command1/log.expect b/src/test/test-service-command1/log.expect
index 02ca900..2b708de 100644
--- a/src/test/test-service-command1/log.expect
+++ b/src/test/test-service-command1/log.expect
@@ -22,7 +22,7 @@ info     25    node3/lrm: starting service vm:103
 info     25    node3/lrm: service status vm:103 started
 info    120      cmdlist: execute service vm:103 disabled
 info    120    node1/crm: service 'vm:103': state changed from 'started' to 'request_stop'
-info    125    node3/lrm: stopping service vm:103
+info    125    node3/lrm: stopping service vm:103 (timeout=60)
 info    125    node3/lrm: service status vm:103 stopped
 info    140    node1/crm: service 'vm:103': state changed from 'request_stop' to 'stopped'
 info    220      cmdlist: execute service vm:103 started
diff --git a/src/test/test-shutdown-policy1/log.expect b/src/test/test-shutdown-policy1/log.expect
index b80799d..0e094b4 100644
--- a/src/test/test-shutdown-policy1/log.expect
+++ b/src/test/test-shutdown-policy1/log.expect
@@ -23,7 +23,7 @@ info     25    node3/lrm: service status vm:103 started
 info    120      cmdlist: execute reboot node3
 info    120    node3/lrm: got shutdown request with shutdown policy 'failover'
 info    120    node3/lrm: shutdown LRM, stop all services
-info    125    node3/lrm: stopping service vm:103
+info    125    node3/lrm: stopping service vm:103 (timeout=60)
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126       reboot: execute crm node3 stop
diff --git a/src/test/test-shutdown-policy2/log.expect b/src/test/test-shutdown-policy2/log.expect
index 6e8c172..2abc830 100644
--- a/src/test/test-shutdown-policy2/log.expect
+++ b/src/test/test-shutdown-policy2/log.expect
@@ -24,7 +24,7 @@ info    120      cmdlist: execute shutdown node3
 info    120    node3/lrm: got shutdown request with shutdown policy 'freeze'
 info    120    node3/lrm: shutdown LRM, stop and freeze all services
 info    120    node1/crm: service 'vm:103': state changed from 'started' to 'freeze'
-info    125    node3/lrm: stopping service vm:103
+info    125    node3/lrm: stopping service vm:103 (timeout=60)
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
diff --git a/src/test/test-shutdown1/log.expect b/src/test/test-shutdown1/log.expect
index e46f13f..005fe8b 100644
--- a/src/test/test-shutdown1/log.expect
+++ b/src/test/test-shutdown1/log.expect
@@ -23,7 +23,7 @@ info     25    node3/lrm: service status vm:103 started
 info    120      cmdlist: execute shutdown node3
 info    120    node3/lrm: got shutdown request with shutdown policy 'conditional'
 info    120    node3/lrm: shutdown LRM, stop all services
-info    125    node3/lrm: stopping service vm:103
+info    125    node3/lrm: stopping service vm:103 (timeout=60)
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
diff --git a/src/test/test-shutdown2/log.expect b/src/test/test-shutdown2/log.expect
index bf4c319..6ade001 100644
--- a/src/test/test-shutdown2/log.expect
+++ b/src/test/test-shutdown2/log.expect
@@ -23,7 +23,7 @@ info     25    node3/lrm: service status vm:103 started
 info    120      cmdlist: execute shutdown node3
 info    120    node3/lrm: got shutdown request with shutdown policy 'conditional'
 info    120    node3/lrm: shutdown LRM, stop all services
-info    125    node3/lrm: stopping service vm:103
+info    125    node3/lrm: stopping service vm:103 (timeout=60)
 info    125    node3/lrm: service status vm:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
diff --git a/src/test/test-shutdown3/log.expect b/src/test/test-shutdown3/log.expect
index 571cb89..1ac55de 100644
--- a/src/test/test-shutdown3/log.expect
+++ b/src/test/test-shutdown3/log.expect
@@ -23,7 +23,7 @@ info     25    node3/lrm: service status ct:103 started
 info    120      cmdlist: execute shutdown node3
 info    120    node3/lrm: got shutdown request with shutdown policy 'conditional'
 info    120    node3/lrm: shutdown LRM, stop all services
-info    125    node3/lrm: stopping service ct:103
+info    125    node3/lrm: stopping service ct:103 (timeout=60)
 info    125    node3/lrm: service status ct:103 stopped
 info    126    node3/lrm: exit (loop end)
 info    126     shutdown: execute crm node3 stop
diff --git a/src/test/test-shutdown4/log.expect b/src/test/test-shutdown4/log.expect
index afebeff..ce278c9 100644
--- a/src/test/test-shutdown4/log.expect
+++ b/src/test/test-shutdown4/log.expect
@@ -23,7 +23,7 @@ info     24    node3/crm: status change wait_for_quorum => slave
 info    120      cmdlist: execute shutdown node1
 info    120    node1/lrm: got shutdown request with shutdown policy 'conditional'
 info    120    node1/lrm: shutdown LRM, stop all services
-info    121    node1/lrm: stopping service vm:100
+info    121    node1/lrm: stopping service vm:100 (timeout=60)
 info    121    node1/lrm: service status vm:100 stopped
 info    122    node1/lrm: exit (loop end)
 info    122     shutdown: execute crm node1 stop
-- 
2.20.1





More information about the pve-devel mailing list