[PR #1895] [MERGED] metrics, tuning in tests, db cleanups, fix concurrency issue #2381

Closed
opened 2025-12-29 03:21:00 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/1895
Author: @kradalby
Created: 4/18/2024
Status: Merged
Merged: 4/21/2024
Merged by: @kradalby

Base: mainHead: integration-test-tuning


📝 Commits (8)

  • 3d98df7 add tuning and make timeout arg
  • 75b7fd7 make chatty message trace
  • 068a424 redo metrics
  • 6d5895d lock notifier per node, not per update
  • 4e29109 replace Transcations with Write
  • cd0dcdb use concurrency save connectedmap, more metrics
  • 231d3c1 disable http metrics, they break streaming
  • 644d4d9 renable metrics for http

📊 Changes

28 files changed (+328 additions, -201 deletions)

View changed files

📝 hscontrol/app.go (+4 -3)
📝 hscontrol/auth.go (+3 -28)
📝 hscontrol/auth_noise.go (+0 -1)
📝 hscontrol/db/node.go (+5 -4)
📝 hscontrol/db/node_test.go (+2 -1)
📝 hscontrol/db/preauth_keys_test.go (+2 -2)
📝 hscontrol/db/routes.go (+20 -17)
📝 hscontrol/db/routes_test.go (+33 -22)
📝 hscontrol/grpcv1.go (+12 -8)
📝 hscontrol/mapper/mapper.go (+11 -10)
📝 hscontrol/metrics.go (+92 -12)
📝 hscontrol/noise.go (+4 -0)
hscontrol/notifier/metrics.go (+27 -0)
📝 hscontrol/notifier/notifier.go (+31 -42)
📝 hscontrol/oidc.go (+1 -1)
📝 hscontrol/poll.go (+30 -10)
📝 hscontrol/types/node.go (+2 -1)
📝 integration/acl_test.go (+2 -2)
📝 integration/auth_oidc_test.go (+2 -2)
📝 integration/auth_web_flow_test.go (+2 -2)

...and 8 more files

📄 Description

  • adds WithTuning parameters to hsic and makes retry max wait into an argument for scenario
  • fix some logs that should be trace that was info
  • redo/add metrics for the new update model
  • reduce how long notifier hold locks (per node instead of all nodes)
  • use concurrency safe map for online status (could trigger racy panic), fixes #1862

Signed-off-by: Kristoffer Dalby kristoffer@tailscale.com


🔄 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/1895 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 4/18/2024 **Status:** ✅ Merged **Merged:** 4/21/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `integration-test-tuning` --- ### 📝 Commits (8) - [`3d98df7`](https://github.com/juanfont/headscale/commit/3d98df79230df57a1d17613b9cccf3a7439b37a5) add tuning and make timeout arg - [`75b7fd7`](https://github.com/juanfont/headscale/commit/75b7fd77fb85da4bb27baebcbde5ede005cf90f3) make chatty message trace - [`068a424`](https://github.com/juanfont/headscale/commit/068a42404c53e7b8d0457805cd22ca7faa9a294e) redo metrics - [`6d5895d`](https://github.com/juanfont/headscale/commit/6d5895dff16fed588341ca8db9b042415b37c0ff) lock notifier per node, not per update - [`4e29109`](https://github.com/juanfont/headscale/commit/4e29109613ad1d405f87e13f2802d64f907eed07) replace Transcations with Write - [`cd0dcdb`](https://github.com/juanfont/headscale/commit/cd0dcdb0e70486b1a26667f2bdb97c385435d8c0) use concurrency save connectedmap, more metrics - [`231d3c1`](https://github.com/juanfont/headscale/commit/231d3c123dce9bb1d736a32a1d9801b9dcd9f6fa) disable http metrics, they break streaming - [`644d4d9`](https://github.com/juanfont/headscale/commit/644d4d94a60dcf588801821e0791aa4a876aa984) renable metrics for http ### 📊 Changes **28 files changed** (+328 additions, -201 deletions) <details> <summary>View changed files</summary> 📝 `hscontrol/app.go` (+4 -3) 📝 `hscontrol/auth.go` (+3 -28) 📝 `hscontrol/auth_noise.go` (+0 -1) 📝 `hscontrol/db/node.go` (+5 -4) 📝 `hscontrol/db/node_test.go` (+2 -1) 📝 `hscontrol/db/preauth_keys_test.go` (+2 -2) 📝 `hscontrol/db/routes.go` (+20 -17) 📝 `hscontrol/db/routes_test.go` (+33 -22) 📝 `hscontrol/grpcv1.go` (+12 -8) 📝 `hscontrol/mapper/mapper.go` (+11 -10) 📝 `hscontrol/metrics.go` (+92 -12) 📝 `hscontrol/noise.go` (+4 -0) ➕ `hscontrol/notifier/metrics.go` (+27 -0) 📝 `hscontrol/notifier/notifier.go` (+31 -42) 📝 `hscontrol/oidc.go` (+1 -1) 📝 `hscontrol/poll.go` (+30 -10) 📝 `hscontrol/types/node.go` (+2 -1) 📝 `integration/acl_test.go` (+2 -2) 📝 `integration/auth_oidc_test.go` (+2 -2) 📝 `integration/auth_web_flow_test.go` (+2 -2) _...and 8 more files_ </details> ### 📄 Description - adds WithTuning parameters to hsic and makes retry max wait into an argument for scenario - fix some logs that should be trace that was info - redo/add metrics for the new update model - reduce how long notifier hold locks (per node instead of all nodes) - use concurrency safe map for online status (could trigger racy panic), fixes #1862 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --- <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 03:21:00 +01:00
adam closed this issue 2025-12-29 03:21:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2381