Copilot commented on code in PR #3643:
URL: https://github.com/apache/dubbo-go/pull/3643#discussion_r3758349690


##########
protocol/triple/client.go:
##########
@@ -296,29 +297,27 @@ func (cm *clientManager) callHealthWatch(ctx 
context.Context, service string) (*
        return stream, nil
 }
 
-func genKeepAliveOptions(url *common.URL, tripleConf *global.TripleConfig) 
([]tri.ClientOption, time.Duration, time.Duration, error) {
-       var cliKeepAliveOpts []tri.ClientOption
+func resolveClientKeepaliveOptions(url *common.URL, tripleConf 
*global.TripleConfig) ([]tri.ClientOption, time.Duration, time.Duration, error) 
{
+       var clientKeepaliveOpts []tri.ClientOption

Review Comment:
   The new helper name uses `Keepalive` while existing identifiers in this area 
use `KeepAlive` (e.g., `constant.DefaultKeepAliveInterval`, previous 
`genKeepAliveOptions`). To keep naming consistent and idiomatic across the 
codebase, consider renaming to `resolveClientKeepAliveOptions` and aligning 
related variables (e.g., `clientKeepAliveOpts`).



##########
protocol/triple/client.go:
##########
@@ -172,15 +173,15 @@ func newClientManager(url *common.URL) (*clientManager, 
error) {
                tripleConf = tripleConfRaw.(*global.TripleConfig)
        }
 
-       // Handle keepalive options
-       cliKeepAliveOpts, keepAliveInterval, keepAliveTimeout, 
genKeepAliveOptsErr := genKeepAliveOptions(url, tripleConf)
-       if genKeepAliveOptsErr != nil {
-               logger.Errorf("[Triple][Client] genKeepAliveOpts failed, 
err=%v", genKeepAliveOptsErr)
-               return nil, genKeepAliveOptsErr
+       // Resolve keepalive and size-limit options before choosing the 
transport.
+       clientKeepaliveOpts, keepAliveInterval, keepAliveTimeout, keepaliveErr 
:= resolveClientKeepaliveOptions(url, tripleConf)
+       if keepaliveErr != nil {
+               logger.Errorf("[Triple][Client] resolve client keepalive 
options failed, err=%v", keepaliveErr)

Review Comment:
   This changes the error log text (previously included `genKeepAliveOpts`) 
which can break log-based alerting/dashboards that match on message substrings. 
Consider preserving the previous stable keyword in the message (or adding a 
structured/consistent tag) while still improving readability.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to