[PR #2886] [MERGED] hscontrol/state: make NodeStore batch configuration tunable #2920

Closed
opened 2025-12-29 04:19:40 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2886
Author: @kradalby
Created: 11/14/2025
Status: Merged
Merged: 11/28/2025
Merged by: @kradalby

Base: mainHead: kradalby/slow-tests


📝 Commits (1)

  • 2524f57 hscontrol/state: make NodeStore batch configuration tunable

📊 Changes

11 files changed (+267 additions, -140 deletions)

View changed files

📝 config-example.yaml (+13 -1)
📝 hscontrol/db/node.go (+16 -6)
📝 hscontrol/mapper/batcher_test.go (+12 -11)
📝 hscontrol/state/debug_test.go (+3 -3)
📝 hscontrol/state/endpoint_test.go (+1 -1)
📝 hscontrol/state/ephemeral_test.go (+72 -83)
📝 hscontrol/state/node_store.go (+15 -12)
📝 hscontrol/state/node_store_test.go (+20 -14)
📝 hscontrol/state/state.go (+27 -3)
hscontrol/state/test_helpers.go (+12 -0)
📝 hscontrol/types/config.go (+76 -6)

📄 Description

Previously NodeStore batch size and timeout were hardcoded constants. This made tests slow as sequential operations waited for the full 500ms timeout on each batch.

Add NodeStoreBatchSize and NodeStoreBatchTimeout fields to the Tuning configuration with defaults of 100 and 500ms respectively.

Also document all Tuning struct fields explaining purpose and tradeoffs.

also speeds up tests a lot

claude was used in this pr


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2886 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 11/14/2025 **Status:** ✅ Merged **Merged:** 11/28/2025 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/slow-tests` --- ### 📝 Commits (1) - [`2524f57`](https://github.com/juanfont/headscale/commit/2524f572168fe024d12454409aac386b72d7bdd6) hscontrol/state: make NodeStore batch configuration tunable ### 📊 Changes **11 files changed** (+267 additions, -140 deletions) <details> <summary>View changed files</summary> 📝 `config-example.yaml` (+13 -1) 📝 `hscontrol/db/node.go` (+16 -6) 📝 `hscontrol/mapper/batcher_test.go` (+12 -11) 📝 `hscontrol/state/debug_test.go` (+3 -3) 📝 `hscontrol/state/endpoint_test.go` (+1 -1) 📝 `hscontrol/state/ephemeral_test.go` (+72 -83) 📝 `hscontrol/state/node_store.go` (+15 -12) 📝 `hscontrol/state/node_store_test.go` (+20 -14) 📝 `hscontrol/state/state.go` (+27 -3) ➕ `hscontrol/state/test_helpers.go` (+12 -0) 📝 `hscontrol/types/config.go` (+76 -6) </details> ### 📄 Description Previously NodeStore batch size and timeout were hardcoded constants. This made tests slow as sequential operations waited for the full 500ms timeout on each batch. Add NodeStoreBatchSize and NodeStoreBatchTimeout fields to the Tuning configuration with defaults of 100 and 500ms respectively. Also document all Tuning struct fields explaining purpose and tradeoffs. also speeds up tests a lot claude was used in this pr --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:40 +01:00
adam closed this issue 2025-12-29 04:19:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2920