core: use NM_SHUTDOWN_TIMEOUT_1500_MSEC

At some places we scheduled a timeout in NM_SHUTDOWN_TIMEOUT_MAX_MSEC.
There, we want to make sure that we don't take longer than
NM_SHUTDOWN_TIMEOUT_MAX_MSEC. But this leaves the actual wait time
unspecified.

Those callers don't want to wait an undefined time. They really should
be clear about how long they wait. Hence, use NM_SHUTDOWN_TIMEOUT_1500_MSEC
which makes it clear this is 1500 msec but also chosen to be not longer than
NM_SHUTDOWN_TIMEOUT_MAX_MSEC.
This commit is contained in:
Thomas Haller
2022-02-18 13:36:44 +01:00
parent 8bb85aecda
commit ed9e3bac03
3 changed files with 4 additions and 4 deletions

View File

@@ -546,7 +546,7 @@ _fw_nft_call(GBytes *stdin_buf,
call_data); call_data);
call_data->timeout_source = call_data->timeout_source =
nm_g_source_attach(nm_g_timeout_source_new((NM_SHUTDOWN_TIMEOUT_MAX_MSEC * 2) / 3, nm_g_source_attach(nm_g_timeout_source_new((NM_SHUTDOWN_TIMEOUT_1500_MSEC * 2) / 3,
G_PRIORITY_DEFAULT, G_PRIORITY_DEFAULT,
_fw_nft_call_timeout_cb, _fw_nft_call_timeout_cb,
call_data, call_data,

View File

@@ -291,7 +291,7 @@ _call_destroy_proxy_configuration(NMPacrunnerManager *self,
g_variant_new("(o)", path), g_variant_new("(o)", path),
G_VARIANT_TYPE("()"), G_VARIANT_TYPE("()"),
G_DBUS_CALL_FLAGS_NO_AUTO_START, G_DBUS_CALL_FLAGS_NO_AUTO_START,
NM_SHUTDOWN_TIMEOUT_MAX_MSEC, NM_SHUTDOWN_TIMEOUT_1500_MSEC,
priv->cancellable, priv->cancellable,
_call_destroy_proxy_configuration_cb, _call_destroy_proxy_configuration_cb,
conf_id_ref(conf_id)); conf_id_ref(conf_id));
@@ -315,7 +315,7 @@ _call_create_proxy_configuration(NMPacrunnerManager *self,
conf_id->parameters, conf_id->parameters,
G_VARIANT_TYPE("(o)"), G_VARIANT_TYPE("(o)"),
G_DBUS_CALL_FLAGS_NO_AUTO_START, G_DBUS_CALL_FLAGS_NO_AUTO_START,
NM_SHUTDOWN_TIMEOUT_MAX_MSEC, NM_SHUTDOWN_TIMEOUT_1500_MSEC,
priv->cancellable, priv->cancellable,
_call_create_proxy_configuration_cb, _call_create_proxy_configuration_cb,
conf_id_ref(conf_id)); conf_id_ref(conf_id));

View File

@@ -511,7 +511,7 @@ nm_secret_agent_cancel_call(NMSecretAgent *self, NMSecretAgentCallId *call_id)
g_variant_new("(os)", call_id->path, call_id->setting_name), g_variant_new("(os)", call_id->path, call_id->setting_name),
G_VARIANT_TYPE("()"), G_VARIANT_TYPE("()"),
G_DBUS_CALL_FLAGS_NO_AUTO_START, G_DBUS_CALL_FLAGS_NO_AUTO_START,
NM_SHUTDOWN_TIMEOUT_MAX_MSEC, NM_SHUTDOWN_TIMEOUT_1500_MSEC,
NULL, /* this operation is not cancellable. We rely on the timeout. */ NULL, /* this operation is not cancellable. We rely on the timeout. */
_call_cancel_cb, _call_cancel_cb,
call_id); call_id);