kitex icon indicating copy to clipboard operation
kitex copied to clipboard

fix: discard oneway conn after send complete

Open simon0-o opened this issue 2 years ago • 2 comments

What type of PR is this?

fix

What this PR does / why we need it (en: English/zh: Chinese):

en: discard oneway conn after sending complete, or subsequent requests that send to the same connection may get blocked until the oneway request gets processed by the server zh: 当 oneway 请求发送完毕后,关闭对应的连接,否则后续的发送到该连接上的请求会被阻塞在 server 端,直到 server 端把上一个 oneway 请求处理完。

Which issue(s) this PR fixes:

none

simon0-o avatar Jul 18 '22 09:07 simon0-o

Benchmark

[KITEX-MUX]    100            1024           316765.57(-0.2%)     1.01(+0.0%)     1.27(+0.0%)
[KITEX-MUX]    200            1024           381967.58(+0.2%)     1.52(+0.0%)     1.88(-1.1%)
[KITEX-MUX]    400            1024           410377.42(+0.4%)     2.37(-0.8%)     2.98(-2.6%)
[KITEX-MUX]    600            1024           418612.48(-0.3%)     3.32(+1.2%)     4.18(+0.2%)
[KITEX-MUX]    800            1024           423297.33(-0.4%)     4.24(+0.5%)     5.25(+0.2%)
[KITEX-MUX]    1000           1024           424922.65(+0.6%)     5.15(-0.2%)     6.33(-1.1%)
[KITEX]        100            1024           216221.62(+1.1%)     1.04(-1.0%)     2.49(+1.2%)
[KITEX]        200            1024           217283.06(+0.3%)     1.87(-6.5%)     2.89(-1.7%)
[KITEX]        400            1024           218294.62(+2.0%)     4.13(+2.5%)     5.82(+3.6%)
[KITEX]        600            1024           219085.02(+1.5%)     5.89(-1.0%)     7.83(-0.4%)
[KITEX]        800            1024           217891.52(+1.1%)     7.85(-1.4%)     10.24(-1.3%)
[KITEX]        1000           1024           216930.12(+0.5%)     9.96(+0.8%)     12.47(+0.4%)

simon0-o avatar Jul 18 '22 09:07 simon0-o

Reproduce Code: https://github.com/simon0-o/kitex-tests/blob/fix_discard_oneway_conn_test/thriftrpc/normalcall/normalcall_test.go#L140 Reproduce Steps:

git clone https://github.com/simon0-o/kitex-tests.git
cd kitex-tests
git checkout fix_discard_oneway_conn_test
./run.sh

simon0-o avatar Jul 18 '22 11:07 simon0-o