AlexStocks opened a new issue, #3556:
URL: https://github.com/apache/dubbo-go/issues/3556

   ## Description
   
   Several return values of functions that can fail are explicitly discarded 
(`_ = fn(...)`) or both the value and error are ignored, causing silent 
failures: malformed RPC payloads, unregistered handlers, and unhandled config / 
shutdown errors with no log.
   
   ## Affected locations
   
   ### Protocol / serialization (data integrity)
   
   - `protocol/dubbo/impl/hessian.go:128-143` — `_ = encoder.Encode(...)` for 
protocol version/path/version/method/types (5 places). Encode errors are 
silently dropped, so a bad payload is sent anyway.
   - `protocol/dubbo/hessian2/hessian_request.go:129,151,168` — request field 
encode errors ignored.
   - `protocol/grpc/grpc_invoker.go:128` — `_ = 
hessian2.ReflectResponse(res[0], invocation.Reply())` — response reflection 
failure ignored; caller gets an unfilled result.
   - `protocol/triple/server.go:546,567,583,600` — `_ = 
s.triServer.RegisterUnaryHandler(...)` etc. — handler registration failure is 
silently swallowed, so a service may not be registered without any warning.
   
   ### Config / registry / shutdown (diagnostics)
   
   - `remoting/getty/config.go:143,169` — `_ = 
defaultClientConfig.CheckValidity()` / server — invalid config still takes 
effect.
   - `remoting/polaris/parser/parser.go:91` — `_ = json.Unmarshal(data, 
&searchVal)` — parse failure ignored, empty value used downstream.
   - `registry/nacos/listener.go:242` — `_ = nl.stopListen()` — listener stop 
failure ignored, possible residual listeners.
   - `graceful_shutdown/shutdown.go:425` — `if recover() != nil { ... }` with 
no log; a panic during shutdown is silently swallowed, making diagnosis very 
hard.
   
   ## Suggested fix
   
   - Propagate encode errors from `marshalRequest` / `marshalRequest` paths (at 
least log + return the error where the call site allows it).
   - Log and handle handler-registration errors in the triple server instead of 
discarding them.
   - Add `logger.Warnf` (or return the error) for config validation, JSON 
parse, listener stop, and the `recover()` in graceful shutdown.
   
   This class of issue is also a good candidate for the `errorlint` / `nilerr` 
linters from the proposed enhanced golangci config to prevent regressions.
   
   ## Severity
   
   P1/P2 — silent data corruption (protocol encode) and loss of diagnostics 
(config / shutdown).
   
   ## Environment
   
   - Reproducible on current `develop` tip (3.3.2 prep).
   


-- 
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