core: log warning when sending SIGKILL in nm_utils_kill_child_async()

Processes really should wrap up in a timely manner. If they don't, then
something bad happened somewhere and we should log a warning about that.
This commit is contained in:
Thomas Haller 2022-02-22 17:54:56 +01:00
parent ae0cc9618c
commit 239b3ca2ab
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 8 additions and 8 deletions

View file

@ -411,10 +411,10 @@ _kc_cb_timeout_grace_period(void *user_data)
errsv);
}
} else {
nm_log_dbg(data->log_domain,
"%s: process not terminated after %ld usec. Sending SIGKILL signal",
data->log_name,
(long) (nm_utils_get_monotonic_timestamp_usec() - data->async.wait_start_us));
nm_log_warn(data->log_domain,
"%s: process not terminated after %ld usec. Sending SIGKILL signal",
data->log_name,
(long) (nm_utils_get_monotonic_timestamp_usec() - data->async.wait_start_us));
}
return G_SOURCE_REMOVE;

View file

@ -369,8 +369,8 @@ do_test_nm_utils_kill_child(void)
NMTST_EXPECT_NM_DEBUG("kill child process 'test-a-1-3' (*): wait for process to terminate "
"after sending no signal (0) (send SIGKILL in 1 milliseconds)...");
NMTST_EXPECT_NM_DEBUG("kill child process 'test-a-1-3' (*): process not terminated after * "
"usec. Sending SIGKILL signal");
NMTST_EXPECT_NM_WARN("kill child process 'test-a-1-3' (*): process not terminated after * "
"usec. Sending SIGKILL signal");
NMTST_EXPECT_NM_DEBUG(
"kill child process 'test-a-1-3' (*): terminated by signal 9 (* usec elapsed)");
test_nm_utils_kill_child_async_do("test-a-1-3", pid1a_3, 0, 1, TRUE, &expected_signal_KILL);
@ -405,8 +405,8 @@ do_test_nm_utils_kill_child(void)
NMTST_EXPECT_NM_DEBUG("kill child process 'test-a-4' (*): wait for process to terminate after "
"sending SIGTERM (15) (send SIGKILL in 1 milliseconds)...");
NMTST_EXPECT_NM_DEBUG("kill child process 'test-a-4' (*): process not terminated after * usec. "
"Sending SIGKILL signal");
NMTST_EXPECT_NM_WARN("kill child process 'test-a-4' (*): process not terminated after * usec. "
"Sending SIGKILL signal");
NMTST_EXPECT_NM_DEBUG(
"kill child process 'test-a-4' (*): terminated by signal 9 (* usec elapsed)");
test_nm_utils_kill_child_async_do("test-a-4", pid4a, SIGTERM, 1, TRUE, &expected_signal_KILL);