dubbo-go
dubbo-go copied to clipboard
common MergeURL OOM
Environment
- Server: v3.2
- Client: v3.0.5
- Protocol: dubbo2
- Registry: zk v3.4
Issue description
OOM
Logs
Click me to check logs
Copy logs to here.
Hi @mengccmumu, there was a pull request to fix this problem, see https://github.com/apache/dubbo-go/pull/2223. Could you help us verify this PR on your environment?
already verify this PR, but OOM still occurs
From the picture you provided, I don't see any leaks about the MergeURL
.
From the picture you provided, I don't see any leaks about the
MergeURL
.
you are right .
I will analyze the issue with OOM again .
@mengccmumu 你这个oom解决了吗
We are also experiencing this problem in the production environment and hope to resolve it soon
pprof list:
(pprof) list MergeURL
Total: 489.08MB
ROUTINE ======================== dubbo.apache.org/dubbo-go/v3/common.MergeURL in dubbo.apache.org/dubbo-go/[email protected]/common/url.go
271.67MB 324.67MB (flat, cum) 66.38% of Total
. . 681:// the params of result will be (a1->v1, b1->v2, a2->v3).
. . 682:// You should notice that the value of b1 is v2, not v4.
. . 683:// due to URL is not thread-safe, so this method is not thread-safe
. . 684:func MergeURL(serviceURL *URL, referenceURL *URL) *URL {
. . 685: // After Clone, it is a new URL that there is no thread safe issue.
. 52MB 686: mergedURL := serviceURL.Clone()
. . 687: params := mergedURL.GetParams()
. . 688: // iterator the referenceURL if serviceURL not have the key ,merge in
. . 689: // referenceURL usually will not changed. so change RangeParams to GetParams to avoid the string value copy.// Group get group
. . 690: for key, value := range referenceURL.GetParams() {
. . 691: if v := mergedURL.GetParam(key, ""); len(v) == 0 {
. . 692: if len(value) > 0 {
268.67MB 268.67MB 693: params[key] = value
. . 694: }
. . 695: }
. . 696: }
. . 697:
. . 698: // loadBalance,cluster,retries strategy config
. 1MB 699: methodConfigMergeFcn := mergeNormalParam(params, referenceURL, []string{constant.LoadbalanceKey, constant.ClusterKey, constant.RetriesKey, constant.TimeoutKey})
. . 700: