[PR #2891] [MERGED] fix: data races when accessing github.com/fatedier/frp/client.(*Service).ctl #4652

Closed
opened 2026-05-05 14:46:08 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/2891
Author: @coadler
Created: 4/13/2022
Status: Merged
Merged: 4/14/2022
Merged by: @fatedier

Base: devHead: dev


📝 Commits (2)

📊 Changes

1 file changed (+6 additions, -0 deletions)

View changed files

📝 client/service.go (+6 -0)

📄 Description

Fixes some data races when accessing github.com/fatedier/frp/client.(*Service).ctl.

==================
WARNING: DATA RACE
Read at 0x00c0003d8910 by goroutine 11:
  github.com/fatedier/frp/client.(*Service).GracefulClose()
      /home/colin/go/pkg/mod/github.com/fatedier/frp@v0.41.0/client/service.go:345 +0x57
  github.com/fatedier/frp/client.(*Service).Close()
      /home/colin/go/pkg/mod/github.com/fatedier/frp@v0.41.0/client/service.go:340 +0x5c
  github.com/coder/coder/coderd/devtunnel.New.func2()
      /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:88 +0x50

Previous write at 0x00c0003d8910 by goroutine 10:
  github.com/fatedier/frp/client.(*Service).Run()
      /home/colin/go/pkg/mod/github.com/fatedier/frp@v0.41.0/client/service.go:118 +0x444
  github.com/coder/coder/coderd/devtunnel.New.func1()
      /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:82 +0x39

Goroutine 11 (running) created at:
  github.com/coder/coder/coderd/devtunnel.New()
      /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:86 +0xa87
  github.com/coder/coder/coderd/devtunnel_test.TestTunnel()
      /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel_test.go:41 +0x231
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:1439 +0x213
  testing.(*T).Run.func1()
      /usr/lib/go/src/testing/testing.go:1486 +0x47

Goroutine 10 (running) created at:
  github.com/coder/coder/coderd/devtunnel.New()
      /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:81 +0x9c5
  github.com/coder/coder/coderd/devtunnel_test.TestTunnel()
      /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel_test.go:41 +0x231
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:1439 +0x213
  testing.(*T).Run.func1()
      /usr/lib/go/src/testing/testing.go:1486 +0x47
==================
    testing.go:1312: race detected during execution of test

🔄 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/fatedier/frp/pull/2891 **Author:** [@coadler](https://github.com/coadler) **Created:** 4/13/2022 **Status:** ✅ Merged **Merged:** 4/14/2022 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (2) - [`c89c194`](https://github.com/fatedier/frp/commit/c89c1943e45bf705d24421b9290ea09a70e11bc7) fix: data race in client/service.go - [`9590d69`](https://github.com/fatedier/frp/commit/9590d69297a87cc6fa1f1d874b1e0a326055b0cf) review fixes ### 📊 Changes **1 file changed** (+6 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/service.go` (+6 -0) </details> ### 📄 Description Fixes some data races when accessing `github.com/fatedier/frp/client.(*Service).ctl`. ``` ================== WARNING: DATA RACE Read at 0x00c0003d8910 by goroutine 11: github.com/fatedier/frp/client.(*Service).GracefulClose() /home/colin/go/pkg/mod/github.com/fatedier/frp@v0.41.0/client/service.go:345 +0x57 github.com/fatedier/frp/client.(*Service).Close() /home/colin/go/pkg/mod/github.com/fatedier/frp@v0.41.0/client/service.go:340 +0x5c github.com/coder/coder/coderd/devtunnel.New.func2() /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:88 +0x50 Previous write at 0x00c0003d8910 by goroutine 10: github.com/fatedier/frp/client.(*Service).Run() /home/colin/go/pkg/mod/github.com/fatedier/frp@v0.41.0/client/service.go:118 +0x444 github.com/coder/coder/coderd/devtunnel.New.func1() /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:82 +0x39 Goroutine 11 (running) created at: github.com/coder/coder/coderd/devtunnel.New() /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:86 +0xa87 github.com/coder/coder/coderd/devtunnel_test.TestTunnel() /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel_test.go:41 +0x231 testing.tRunner() /usr/lib/go/src/testing/testing.go:1439 +0x213 testing.(*T).Run.func1() /usr/lib/go/src/testing/testing.go:1486 +0x47 Goroutine 10 (running) created at: github.com/coder/coder/coderd/devtunnel.New() /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel.go:81 +0x9c5 github.com/coder/coder/coderd/devtunnel_test.TestTunnel() /home/colin/Projects/coder/coder/coderd/devtunnel/tunnel_test.go:41 +0x231 testing.tRunner() /usr/lib/go/src/testing/testing.go:1439 +0x213 testing.(*T).Run.func1() /usr/lib/go/src/testing/testing.go:1486 +0x47 ================== testing.go:1312: race detected during execution of test ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:46:08 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#4652
No description provided.