[PR #3869] [CLOSED] fix: duplicate call loginFunc (#3860) #4848

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

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/3869
Author: @im-zhou
Created: 12/20/2023
Status: Closed

Base: devHead: dev


📄 Description

主要问题在:

	// try to reconnect to server until success
	wait.BackoffUntil(loginFunc, wait.NewFastBackoffManager(
		wait.FastBackoffOptions{
			Duration:    time.Second,
			Factor:      2,
			Jitter:      0.1,
			MaxDuration: maxInterval,
		}),
		true,
		wait.MergeAndCloseOnAnyStopChannel(svr.ctx.Done(), successCh))

此 wait 可能造成重复调用 loginFunc,将 Duration: time.Second 设置为更小的时间,近乎完全复现

使用 chan 阻塞 loginFunc,应该没什么大问题 :xd: ( 本地测试未再发生 panic )


🔄 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/3869 **Author:** [@im-zhou](https://github.com/im-zhou) **Created:** 12/20/2023 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📄 Description 主要问题在: ```go // try to reconnect to server until success wait.BackoffUntil(loginFunc, wait.NewFastBackoffManager( wait.FastBackoffOptions{ Duration: time.Second, Factor: 2, Jitter: 0.1, MaxDuration: maxInterval, }), true, wait.MergeAndCloseOnAnyStopChannel(svr.ctx.Done(), successCh)) ``` 此 wait 可能造成重复调用 `loginFunc`,将 `Duration: time.Second` 设置为更小的时间,近乎完全复现 使用 chan 阻塞 `loginFunc`,应该没什么大问题 :xd: ( 本地测试未再发生 panic ) --- <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:49:52 -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#4848
No description provided.