summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-02-18 15:00:37 +0100
committerThomas Haller <thaller@redhat.com>2022-02-24 09:38:53 +0100
commit2ebf9a0e89eadf11d9acdacd008e8655d28a9ad2 (patch)
tree4d15936a4fe0451455bcd8a8a9d2c09f8930764c
parented9e3bac0357e4666f218e50f79c3e1208dfb71b (diff)
downloadNetworkManager-2ebf9a0e89eadf11d9acdacd008e8655d28a9ad2.tar.gz
core: increase NM_SHUTDOWN_TIMEOUT_MAX_MSEC to 5 sec to cover pppd
NM_SHUTDOWN_TIMEOUT_MAX_MSEC is the maximum timeout for how long any async operation may take. The idea is that during shutdown of NetworkManager we give that much time to tear down. Then async operations may either implement cancellation or not bother with that. But in any case, they must complete within NM_SHUTDOWN_TIMEOUT_MAX_MSEC. Actually, for the time being, this has no effect at all. I am talking about the future here. See "Improve Shutdown of NetworkManager" in TODO. This patch is preparation for that effort. Anyway. Stopping pppd can take a longer time (5 seconds). That is currently the (known) longest time how long any of our async operations is allowed to take. As all async operations must complete before NM_SHUTDOWN_TIMEOUT_MAX_MSEC, and we want to wait at least 5 seconds for pppd, we need to increase the wait time NM_SHUTDOWN_TIMEOUT_MAX_MSEC. Also add and use NM_SHUTDOWN_TIMEOUT_5000_MSEC, which serves a similar purpose as NM_SHUTDOWN_TIMEOUT_1500_MSEC.
-rw-r--r--src/core/NetworkManagerUtils.c1
-rw-r--r--src/core/NetworkManagerUtils.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c
index 2f30bcaa39..b7dd104b45 100644
--- a/src/core/NetworkManagerUtils.c
+++ b/src/core/NetworkManagerUtils.c
@@ -35,6 +35,7 @@
/*****************************************************************************/
G_STATIC_ASSERT(NM_SHUTDOWN_TIMEOUT_1500_MSEC <= NM_SHUTDOWN_TIMEOUT_MAX_MSEC);
+G_STATIC_ASSERT(NM_SHUTDOWN_TIMEOUT_5000_MSEC <= NM_SHUTDOWN_TIMEOUT_MAX_MSEC);
/*****************************************************************************/
diff --git a/src/core/NetworkManagerUtils.h b/src/core/NetworkManagerUtils.h
index fce940073b..67c9cba471 100644
--- a/src/core/NetworkManagerUtils.h
+++ b/src/core/NetworkManagerUtils.h
@@ -118,7 +118,7 @@ NMPlatformRoutingRule *nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rul
* So, the maximum time we should wait before sending SIGKILL should be at most
* NM_SHUTDOWN_TIMEOUT_MAX_MSEC.
*/
-#define NM_SHUTDOWN_TIMEOUT_MAX_MSEC 1500
+#define NM_SHUTDOWN_TIMEOUT_MAX_MSEC 5000
#define NM_SHUTDOWN_TIMEOUT_ADDITIONAL_MSEC 500
/**
@@ -132,6 +132,9 @@ NMPlatformRoutingRule *nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rul
*/
#define NM_SHUTDOWN_TIMEOUT_1500_MSEC 1500
+/* See NM_SHUTDOWN_TIMEOUT_1500_MSEC. */
+#define NM_SHUTDOWN_TIMEOUT_5000_MSEC 5000
+
typedef enum {
/* There is no watched_obj argument, and the shutdown is delayed until the user
* explicitly calls unregister on the returned handle. */