Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agent 在网络不好的情况下,频繁调用SendMetrics方法会导致fd增多和内存升高 #980

Open
lingqi7 opened this issue Feb 28, 2025 · 1 comment

Comments

@lingqi7
Copy link

lingqi7 commented Feb 28, 2025

  • TransferClients 中的conn没有被释放,导致一直创建
@lingqi7
Copy link
Author

lingqi7 commented Feb 28, 2025

func updateMetrics(c *SingleConnRpcClient, metrics []*model.MetricValue, resp *model.TransferResponse) bool {
	err := c.Call("Transfer.Update", metrics, resp)
	if err != nil {
		log.Println("call Transfer.Update fail:", c, err)
                TransferClientsLock.Lock()
		defer TransferClientsLock.Unlock()
		delete(TransferClients, c.RpcServer)      // 清理conn
		return false
	}
	return true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant