Commit 6d696a3541 for bind

commit 6d696a3541b1590598a48ed5e96c315d098ee7a7
Author: Colin Vidal <colin@isc.org>
Date:   Wed Nov 25 17:09:52 2026 +0100

    Reset uv time after isc_loopmgr_nonblocking()

    Functions `isc_loopmgr_blocking()` and `isc_loopmgr_nonblocking()` are
    called by tools which can block their current loop for multiples
    reasons: resolving a name, waiting for a user input.

    Since UV caches the current time at the begining of the tick, the time
    after the user typed something (for instance) can be fundamentally
    later. This could triggers issues later. For instance, triggering an
    immediate timeout error when attempting to make a TCP request, since the
    UV code doing the query relies on its internally cached time.

    To solve the issues in a generic way (instead of having special handling
    in each tools, like moving the post blocking action into a separate
    tick), call `uv_update_time()` inside `isc_loopmgr_nonblocking()` API,
    if the event-loop is started.

    This enable to have the current loop cached time up-to-date after a
    blocking action.

diff --git a/lib/isc/include/isc/loop.h b/lib/isc/include/isc/loop.h
index e5dbd8ccd3..90f85271ea 100644
--- a/lib/isc/include/isc/loop.h
+++ b/lib/isc/include/isc/loop.h
@@ -183,6 +183,12 @@ isc_loopmgr_nonblocking(void);
  * isc_loopmgr_blocking() stops the SIGINT and SIGTERM signal handlers
  * during blocking operations, for example while waiting for user
  * interaction; isc_loopmgr_nonblocking() restarts them.
+ *
+ * Because of this, `isc_loopmgr_nonblocking()` also internally calls
+ * `uv_update_time()` from the current loop which ensures that code running
+ * after `_nonblocking()` call would have the updated current time. (It's
+ * important, for instance, if there are network IO to avoid wrong timeout
+ * detections.)
  */

 isc_time_t
diff --git a/lib/isc/loop.c b/lib/isc/loop.c
index 7828decb6b..e706c26669 100644
--- a/lib/isc/loop.c
+++ b/lib/isc/loop.c
@@ -607,10 +607,22 @@ isc_loopmgr_blocking(void) {

 void
 isc_loopmgr_nonblocking(void) {
+	isc_loop_t *loop = isc_loop();
+
 	REQUIRE(VALID_LOOPMGR(isc__loopmgr));

 	isc_signal_start(isc__loopmgr->sigint);
 	isc_signal_start(isc__loopmgr->sigterm);
+
+	/*
+	 * If an event-loop is set-up at this stage, then update the current
+	 * time of the current loop. Avoid the caller depending on uv time (i.e.
+	 * network IO) to use an old time cached at the beginning of the loop
+	 * event.
+	 */
+	if (loop != NULL) {
+		uv_update_time(&loop->loop);
+	}
 }

 isc_time_t