From: Michael Tremer <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. 004b1ce1dc6b63afce57f0f69876d44a45e9f87a
Date: Wed, 02 Dec 2026 16:13:17 +0000 (UTC) [thread overview]
Message-ID: <4jfjV61YxQz2xg0@people01.haj.ipfire.org> (raw)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, master has been updated
via 004b1ce1dc6b63afce57f0f69876d44a45e9f87a (commit)
via 24c801b0c65d3249a7bea7ae6f19ef729cade2fb (commit)
from 2ea8ebadf05c4e9766316418d71ac407da33e05c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
config/knot-resolver/config.yaml | 4 +-
lfs/knot-resolver | 2 +
.../knot-resolver-6.4.2-tls-task-leak.patch | 28 +++++++++++++
src/patches/knot-resolver-6.4.2-workers-max.patch | 48 ++++++++++++++++++++++
4 files changed, 81 insertions(+), 1 deletion(-)
create mode 100644 src/patches/knot-resolver-6.4.2-tls-task-leak.patch
create mode 100644 src/patches/knot-resolver-6.4.2-workers-max.patch
Difference in files:
diff --git a/config/knot-resolver/config.yaml b/config/knot-resolver/config.yaml
index 7a2dd29fb8..22d90f9ecd 100644
--- a/config/knot-resolver/config.yaml
+++ b/config/knot-resolver/config.yaml
@@ -14,8 +14,10 @@ network:
do-ipv4: true
do-ipv6: false
-# Start as many workers as we have CPU threads
+# Start as many workers as we have CPU threads, but not more than eight
+# because every worker uses its own memory
workers: auto
+workers-max: 8
# Enable a persistent cache
cache:
diff --git a/lfs/knot-resolver b/lfs/knot-resolver
index 3c9839d908..dc6984329c 100644
--- a/lfs/knot-resolver
+++ b/lfs/knot-resolver
@@ -72,6 +72,8 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/knot-resolver-6.5-keep-dst-ip.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/knot-resolver-6.4.2-api-socket-permissions.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/knot-resolver-6.4.2-workers-max.patch
+ cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/knot-resolver-6.4.2-tls-task-leak.patch
cd $(DIR_APP) && meson setup \
--buildtype=release \
--prefix=/usr \
diff --git a/src/patches/knot-resolver-6.4.2-tls-task-leak.patch b/src/patches/knot-resolver-6.4.2-tls-task-leak.patch
new file mode 100644
index 0000000000..44629c2b66
--- /dev/null
+++ b/src/patches/knot-resolver-6.4.2-tls-task-leak.patch
@@ -0,0 +1,28 @@
+daemon/worker: do not register tasks with sessions closed while sending
+
+When a write on a TLS connection to an upstream server cannot be completed
+at once, kresd closes the session from within session2_wrap(). qr_task_send()
+still returned success and added the task to the task list of the closed
+session, which had already been cleaned up. The task was never freed again.
+
+Upstream: https://gitlab.nic.cz/knot/knot-resolver/-/work_items/967
+
+diff --git a/daemon/worker.c b/daemon/worker.c
+index 63d07a644..47e591754 100644
+--- a/daemon/worker.c
++++ b/daemon/worker.c
+@@ -675,6 +675,14 @@ static int qr_task_send(struct qr_task *task, struct session2 *session,
+ payload.ttl = packet_ttl(pkt);
+ ret = session2_wrap(session, payload, comm, &task->ctx->req, qr_task_wrap_finished, task);
+
++ /* The session might have been closed while sending (e.g. when the OS
++ * buffer was full). It has already been cleaned up by then, so the task
++ * must not be registered with it, or it would never be released. */
++ if (ret >= 0 && session->closing) {
++ VERBOSE_MSG(NULL, "session closed while sending, not registering task\n");
++ ret = kr_error(ECONNRESET);
++ }
++
+ if (ret >= 0) {
+ session2_touch(session);
+ if (session->outgoing) {
diff --git a/src/patches/knot-resolver-6.4.2-workers-max.patch b/src/patches/knot-resolver-6.4.2-workers-max.patch
new file mode 100644
index 0000000000..0fb62df7a8
--- /dev/null
+++ b/src/patches/knot-resolver-6.4.2-workers-max.patch
@@ -0,0 +1,48 @@
+diff --git a/python/knot_resolver/datamodel/config_schema.py b/python/knot_resolver/datamodel/config_schema.py
+--- a/python/knot_resolver/datamodel/config_schema.py
++++ b/python/knot_resolver/datamodel/config_schema.py
+@@ -96,6 +96,7 @@ class KresConfig(ConfigSchema):
+ hostname: Internal DNS resolver hostname. Default is machine hostname.
+ rundir: Directory where the resolver can create files and which will be it's cwd.
+ workers: The number of running kresd (Knot Resolver daemon) workers. If set to 'auto', it is equal to number of CPUs available.
++ workers_max: The maximum number of kresd (Knot Resolver daemon) workers to start if 'workers' is set to 'auto'.
+ management: Configuration of management HTTP API.
+ options: Fine-tuning global parameters of DNS resolver operation.
+ network: Network connections and protocols configuration.
+@@ -118,6 +119,7 @@ class KresConfig(ConfigSchema):
+ hostname: Optional[EscapedStr] = None
+ rundir: WritableDir = lazy_default(WritableDir, str(RUN_DIR))
+ workers: Union[Literal["auto"], IntPositive] = IntPositive(1)
++ workers_max: Optional[IntPositive] = None
+ management: ManagementSchema = lazy_default(ManagementSchema, {"unix-socket": str(API_SOCK_FILE)})
+ options: OptionsSchema = OptionsSchema()
+ network: NetworkSchema = NetworkSchema()
+@@ -141,6 +143,7 @@ class KresConfig(ConfigSchema):
+ hostname: EscapedStr
+ rundir: WritableDir
+ workers: IntPositive
++ workers_max: Optional[IntPositive]
+ management: ManagementSchema
+ options: OptionsSchema
+ network: NetworkSchema
+@@ -180,6 +183,9 @@ class KresConfig(ConfigSchema):
+
+ count = _cpu_count()
+ if count:
++ # do not start more workers than allowed
++ if obj.workers_max is not None:
++ count = min(count, int(obj.workers_max))
+ return IntPositive(count)
+ raise ValueError(
+ "The number of available CPUs to automatically set the number of running 'kresd' workers could not be determined."
+diff --git a/python/knot_resolver/manager/manager.py b/python/knot_resolver/manager/manager.py
+--- a/python/knot_resolver/manager/manager.py
++++ b/python/knot_resolver/manager/manager.py
+@@ -118,6 +118,7 @@ class KresManager: # pylint: disable=too-many-instance-attributes
+ config.hostname,
+ # config.rundir not allowed to change
+ config.workers,
++ # config.workers_max is already reflected in config.workers
+ # config.management not allowed to change and not affecting workers anyway
+ config.options,
+ config.network,
hooks/post-receive
--
IPFire 2.x development tree
reply other threads:[~2026-12-02 16:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4jfjV61YxQz2xg0@people01.haj.ipfire.org \
--to=git@ipfire.org \
--cc=ipfire-scm@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox