[PR #2449] [MERGED] [management] Add buffering for getAccount requests during login #15170

Closed
opened 2026-08-05 03:07:06 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2449
Author: @pascal-fischer
Created: 8/19/2024
Status: Merged
Merged: 8/20/2024
Merged by: @pascal-fischer

Base: mainHead: fix/get-account-request-collect


📝 Commits (10+)

  • 36185eb add buffering for get account requests during login
  • 12884e0 have db calls in parallel per account
  • a100d61 default to 100ms
  • 5a9f169 move channel close and add ctx + logs
  • 096f42d renamed methods and variables
  • 9062876 add buffer interval env variable
  • 1e4ecf0 upload performance test
  • cbcd28c update logs in tests
  • d6af47a typo
  • 83c3de2 mark helper

📊 Changes

4 files changed (+329 additions, -6 deletions)

View changed files

📝 management/server/account.go (+3 -0)
management/server/account_cache.go (+106 -0)
📝 management/server/management_proto_test.go (+219 -5)
📝 management/server/peer.go (+1 -1)

📄 Description

Describe your changes

This PR adds a buffer for the getAccount operation during login to collect requests over a specific time inteval and only call the database once. This way reducing overall load on the DB.

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/netbirdio/netbird/pull/2449 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 8/19/2024 **Status:** ✅ Merged **Merged:** 8/20/2024 **Merged by:** [@pascal-fischer](https://github.com/pascal-fischer) **Base:** `main` ← **Head:** `fix/get-account-request-collect` --- ### 📝 Commits (10+) - [`36185eb`](https://github.com/netbirdio/netbird/commit/36185ebb4013a07da3ede635a7dfc37593859410) add buffering for get account requests during login - [`12884e0`](https://github.com/netbirdio/netbird/commit/12884e0e11fdab60c14dcaca80d30d05d5bc9b1c) have db calls in parallel per account - [`a100d61`](https://github.com/netbirdio/netbird/commit/a100d61fe47855d877326ec072a3ec2145c33f2b) default to 100ms - [`5a9f169`](https://github.com/netbirdio/netbird/commit/5a9f169dc8f90a2e52a7da158eadf8963e6693ba) move channel close and add ctx + logs - [`096f42d`](https://github.com/netbirdio/netbird/commit/096f42d0af142ad19e9f3360c723523e1c146aee) renamed methods and variables - [`9062876`](https://github.com/netbirdio/netbird/commit/90628769a7e0bb1a2df1eaa2bf16b80ca1c9285b) add buffer interval env variable - [`1e4ecf0`](https://github.com/netbirdio/netbird/commit/1e4ecf0c36c316ce8845a01b25a61900230eb2c1) upload performance test - [`cbcd28c`](https://github.com/netbirdio/netbird/commit/cbcd28cc40bc7d0904f0c1cc58491cb8ada33c76) update logs in tests - [`d6af47a`](https://github.com/netbirdio/netbird/commit/d6af47a8da82377e8c6508a4bf55d57dda9ed002) typo - [`83c3de2`](https://github.com/netbirdio/netbird/commit/83c3de2fa99f4365230c73c5f0c0cbd18d211fba) mark helper ### 📊 Changes **4 files changed** (+329 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `management/server/account.go` (+3 -0) ➕ `management/server/account_cache.go` (+106 -0) 📝 `management/server/management_proto_test.go` (+219 -5) 📝 `management/server/peer.go` (+1 -1) </details> ### 📄 Description ## Describe your changes This PR adds a buffer for the getAccount operation during login to collect requests over a specific time inteval and only call the database once. This way reducing overall load on the DB. ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:07:06 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#15170