Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbus: Remove the upper limit on try timeout (LP: #1967084) #271

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,11 @@ method_try(sd_bus_message *m, void *userdata, sd_bus_error *ret_error)
// LCOV_EXCL_STOP

/* wait for the /run/netplan/netplan-try.ready stamp file to appear */
guint poll_timeout = 500;
if (seconds > 0 && seconds < 5)
guint poll_timeout = 1000;
/* Replace the default timeout with the one specified by the caller */
if (seconds > 0)
poll_timeout = seconds * 100;
/* Timeout after up to 5 sec of waiting for the stamp file */
/* Timeout after up to 10 sec of waiting for the stamp file */
for (int i = 0; i < poll_timeout; i++) {
if (stat(netplan_try_stamp, &buf) == 0)
break;
Expand Down