dubbo-go icon indicating copy to clipboard operation
dubbo-go copied to clipboard

common MergeURL OOM

Open mengccmumu opened this issue 1 year ago • 6 comments

Environment

  • Server: v3.2
  • Client: v3.0.5
  • Protocol: dubbo2
  • Registry: zk v3.4

Issue description

OOM image image

Logs

Click me to check logs
Copy logs to here.


mengccmumu avatar Jun 12 '23 04:06 mengccmumu

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?

justxuewei avatar Jun 19 '23 01:06 justxuewei

already verify this PR, but OOM still occurs image

mengccmumu avatar Jun 28 '23 08:06 mengccmumu

From the picture you provided, I don't see any leaks about the MergeURL.

justxuewei avatar Jul 02 '23 05:07 justxuewei

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 avatar Jul 03 '23 06:07 mengccmumu

@mengccmumu 你这个oom解决了吗

bigwalle avatar Jul 26 '23 09:07 bigwalle

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:

image

licon avatar Mar 25 '24 07:03 licon