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

fix: limit rpc package data size by user's config rather than DEFAULT_LEN. #1848

Merged
merged 2 commits into from
May 8, 2022

Conversation

sheny1xuan
Copy link
Contributor

@sheny1xuan sheny1xuan commented Apr 20, 2022

What this PR does:

  • Dubbo recommand package data length not greater than 8MiB.
  • If package data length greater than 8MiB, generate warnning.
  • If package data lenght greater than user's config, generate exception.

Signed-off-by: stonex 1479765922@qq.com
Which issue(s) this PR fixes:
Fixes #1839

You should pay attention to items below to ensure your pr passes our ci test
We do not merge pr with ci tests failed

  • All ut passed (run 'go test ./...' in project root)
  • After go-fmt ed , run 'go fmt project' using goland.
  • Golangci-lint passed, run 'sudo golangci-lint run' in project root.
  • After import formatted, (using imports-formatter to run 'imports-formatter .' in project root, to format your import blocks, mentioned in CONTRIBUTING.md above)
  • Your new-created file needs to have apache license at the top, like other existed file does.
  • All integration test passed. You can run integration test locally (with docker env). Clone our dubbo-go-samples project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support)

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2022

Codecov Report

Merging #1848 (bafa198) into 3.0 (605764e) will decrease coverage by 0.05%.
The diff coverage is 13.33%.

@@            Coverage Diff             @@
##              3.0    #1848      +/-   ##
==========================================
- Coverage   46.76%   46.70%   -0.06%     
==========================================
  Files         298      298              
  Lines       17178    17200      +22     
==========================================
  Hits         8034     8034              
- Misses       8291     8310      +19     
- Partials      853      856       +3     
Impacted Files Coverage Δ
protocol/dubbo/hessian2/hessian_request.go 65.24% <0.00%> (-0.47%) ⬇️
protocol/dubbo/hessian2/hessian_response.go 53.21% <0.00%> (-0.25%) ⬇️
protocol/dubbo/impl/codec.go 41.13% <0.00%> (-0.53%) ⬇️
remoting/getty/readwriter.go 35.13% <22.22%> (-4.16%) ⬇️
filter/metrics/filter.go 85.00% <0.00%> (-15.00%) ⬇️
metrics/prometheus/reporter.go 26.85% <0.00%> (-1.72%) ⬇️
remoting/xds/client.go 56.00% <0.00%> (ø)
...tocol/rest/server/server_impl/go_restful_server.go 44.82% <0.00%> (+3.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 605764e...bafa198. Read the comment docs.

@AlexStocks
Copy link
Contributor

在日志中,提示下,如果通信的对端是 dubbo java,则dubbo java 无法处理超过 DEFAULT_LEN(8MiB) 的包。

…_LEN

  * Dubbo recommand package data length not greater than 8MiB.
  * If package data length greater than 8MiB, generate warnning.
  * If package data lenght greater than user's config, generate exception.

Signed-off-by: stonex <1479765922@qq.com>
return nil, perrors.Errorf("Data length %d too large, max payload %d", pkgLen, DEFAULT_LEN)
if pkgLen > int(DEFAULT_LEN) { // recommand 8M
logger.Warnf("Data length %d too large, recommand max payload %d. "+
"Dubbo java can't handle the package which size greater than %d!!!", pkgLen, DEFAULT_LEN, DEFAULT_LEN)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which size greater than = whose size is greater than

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@AlexStocks AlexStocks merged commit bd9806c into apache:3.0 May 8, 2022
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

Successfully merging this pull request may close these issues.

5 participants