[PR #75] [MERGED] Fix deadlock issue #1240

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/75
Author: @kradalby
Created: 8/5/2021
Status: Merged
Merged: 8/6/2021
Merged by: @juanfont

Base: mainHead: syncmap


📝 Commits (10+)

📊 Changes

12 files changed (+345 additions, -98 deletions)

View changed files

📝 README.md (+5 -0)
📝 acls.go (+6 -3)
📝 api.go (+230 -55)
📝 app.go (+14 -11)
📝 cmd/headscale/cli/root.go (+3 -2)
📝 cmd/headscale/cli/utils.go (+21 -10)
📝 cmd/headscale/headscale.go (+28 -2)
📝 go.mod (+1 -0)
📝 go.sum (+2 -0)
📝 machine.go (+3 -2)
📝 namespaces.go (+30 -11)
📝 routes.go (+2 -2)

📄 Description

This PR depends on (or contains if you like) #74, please review that first and merge that / or just merge this when both are reviewed.

This PR removes most of the locks in the PollingMap handler as there
was combinations that caused deadlocks. Instead of doing a plain map and
doing the locking ourselves, we use sync.Map which handles it for us.

This should resolve #56 #50 and #73


🔄 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/75 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 8/5/2021 **Status:** ✅ Merged **Merged:** 8/6/2021 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `syncmap` --- ### 📝 Commits (10+) - [`ee704f8`](https://github.com/juanfont/headscale/commit/ee704f8ef35b6ebf54eaad0f7bfd65991ab29739) Initial port to zerologger - [`0bb2fab`](https://github.com/juanfont/headscale/commit/0bb2fabc6c6b6120bb29da1bea484bd9fe3b145a) Convert missing from api.go - [`42bf566`](https://github.com/juanfont/headscale/commit/42bf566ffffceb505eb7acbf7391fd9f12dbe566) Convert acls.go - [`d10b57b`](https://github.com/juanfont/headscale/commit/d10b57b317ec3e8dff17f815541a1c43f50dd51c) Convert namespaces.go - [`b120014`](https://github.com/juanfont/headscale/commit/b1200140b870446fd66a7f8cc82ca9c323b62f0e) Convert cli/utils.go - [`0660867`](https://github.com/juanfont/headscale/commit/0660867a1628250382c210b2af0b7a33c09864e8) Correct url - [`cd2ca13`](https://github.com/juanfont/headscale/commit/cd2ca137c0a58d3ee911e8ff3a67abe5d56214f6) Make log_level user configurable - [`a8c8a35`](https://github.com/juanfont/headscale/commit/a8c8a358d0dcad845158e96eb5eca41385e26733) Make log keys lowercase - [`575b15e`](https://github.com/juanfont/headscale/commit/575b15e5fa737124d7203ecd4f005196f64d71b2) Add more trace logging - [`1abc68c`](https://github.com/juanfont/headscale/commit/1abc68ccf42794756a61e7c2e850051e79b5a1e0) Removes locks causing deadlock ### 📊 Changes **12 files changed** (+345 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+5 -0) 📝 `acls.go` (+6 -3) 📝 `api.go` (+230 -55) 📝 `app.go` (+14 -11) 📝 `cmd/headscale/cli/root.go` (+3 -2) 📝 `cmd/headscale/cli/utils.go` (+21 -10) 📝 `cmd/headscale/headscale.go` (+28 -2) 📝 `go.mod` (+1 -0) 📝 `go.sum` (+2 -0) 📝 `machine.go` (+3 -2) 📝 `namespaces.go` (+30 -11) 📝 `routes.go` (+2 -2) </details> ### 📄 Description This PR depends on (or contains if you like) #74, please review that first and merge that / or just merge this when both are reviewed. This PR removes most of the locks in the PollingMap handler as there was combinations that caused deadlocks. Instead of doing a plain map and doing the locking ourselves, we use sync.Map which handles it for us. This should resolve #56 #50 and #73 --- <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 02:29:25 +01:00
adam closed this issue 2025-12-29 02:29:25 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1240