Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8b9f2ec
fix:set url to nil when destroy base invoker and change the order of …
Aug 8, 2024
5033986
Merge pull request #1 from No-SilverBullet/fix/url_memory_leak
No-SilverBullet Aug 8, 2024
fb5763a
add comment at BaseInvoker.Destroy()
Aug 9, 2024
ca87720
Merge pull request #2 from No-SilverBullet/fix/url_memory_leak
No-SilverBullet Aug 9, 2024
9bb0276
feat:add keepalive config and pass through to http2 transport
Nov 22, 2024
a2b0d2f
Merge branch 'apache:main' into main
No-SilverBullet Nov 22, 2024
37ff642
Merge branch 'main' of github.com:No-SilverBullet/dubbo-go into feat/…
Nov 22, 2024
2d44df3
chore:update comments for clarity
Nov 22, 2024
59d2395
chore:update comments for clarity
Nov 22, 2024
e4680c1
feat:add keepalive parameters to dubbogo/triple and preallocate the c…
Dec 3, 2024
8c3c67e
feat:add keepalive parameters, default interval is 10s, and timeout v…
Dec 3, 2024
63400e8
fix:golang lint ci error
Dec 3, 2024
4774b77
fix:typo
Dec 3, 2024
31db567
refactor:add space
Dec 5, 2024
a3190d0
refactor:add space for comment
Dec 5, 2024
930461a
refactor:add space for comment
Dec 5, 2024
96a2a35
fix err return which issued in issue2762
Dec 17, 2024
e9d35cc
Merge branch 'develop' of github.com:No-SilverBullet/dubbo-go into fi…
Dec 17, 2024
cd3a4ae
fix err return which issued in issue2762
Dec 17, 2024
d26371d
fix:remove restclient set deadline
No-SilverBullet Mar 2, 2025
4c40406
Merge branch 'fix/return_err' into fix/remove_setdeadline
No-SilverBullet Mar 2, 2025
456068f
import format
No-SilverBullet Mar 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions protocol/rest/client/client_impl/resty_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"net"
"net/http"
"path"
"time"
)

import (
Expand Down Expand Up @@ -56,13 +55,11 @@ func NewRestyClient(restOption *client.RestOptions) client.RestClient {
if err != nil {
return nil, err
}
err = c.SetDeadline(time.Now().Add(restOption.RequestTimeout))
if err != nil {
return nil, err
}
return c, nil
},
IdleConnTimeout: restOption.KeppAliveTimeout,
})
client.SetTimeout(restOption.RequestTimeout)
return &RestyClient{
client: client,
}
Expand Down
5 changes: 3 additions & 2 deletions protocol/rest/client/rest_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (
)

type RestOptions struct {
RequestTimeout time.Duration
ConnectTimeout time.Duration
RequestTimeout time.Duration
ConnectTimeout time.Duration
KeppAliveTimeout time.Duration
}

type RestClientRequest struct {
Expand Down
3 changes: 2 additions & 1 deletion protocol/rest/rest_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (rp *RestProtocol) Refer(url *common.URL) protocol.Invoker {
requestTimeout := time.Duration(3 * time.Second)
requestTimeoutStr := url.GetParam(constant.TimeoutKey, "3s")
connectTimeout := requestTimeout // config.GetConsumerConfig().ConnectTimeout
keepAliveTimeout := url.GetParamDuration(constant.KeepAliveTimeout, constant.DefaultKeepAliveTimeout)
// end
if t, err := time.ParseDuration(requestTimeoutStr); err == nil {
requestTimeout = t
Expand All @@ -103,7 +104,7 @@ func (rp *RestProtocol) Refer(url *common.URL) protocol.Invoker {
logger.Errorf("%s service doesn't has consumer config", url.Path)
return nil
}
restOptions := client.RestOptions{RequestTimeout: requestTimeout, ConnectTimeout: connectTimeout}
restOptions := client.RestOptions{RequestTimeout: requestTimeout, ConnectTimeout: connectTimeout, KeppAliveTimeout: keepAliveTimeout}
restClient := rp.getClient(restOptions, restServiceConfig.Client)
invoker := NewRestInvoker(url, &restClient, restServiceConfig.RestMethodConfigsMap)
rp.SetInvokers(invoker)
Expand Down
Loading