lin-jianjun opened a new issue #1025:
URL: https://github.com/apache/dubbo-go/issues/1025
<!-- Please use this template while reporting a bug and provide as much info
as possible. Not doing so may result in your bug not being addressed in a
timely manner. Thanks!
-->
**What happened**:
竞态告警
WARNING: DATA RACE
Write at 0x00c000620630 by goroutine 53:
sync/atomic.AddInt64()
/usr/lib/golang/src/runtime/race_amd64.s:276 +0xb
github.com/apache/dubbo-go/protocol/dubbo.(*DubboInvoker).Invoke()
/root/go/pkg/mod/github.com/apache/[email protected]/protocol/dubbo/dubbo_invoker.go:146
+0x830
Previous read at 0x00c000620630 by goroutine 1137:
github.com/apache/dubbo-go/protocol/dubbo.(*DubboInvoker).Invoke()
/root/go/pkg/mod/github.com/apache/[email protected]/protocol/dubbo/dubbo_invoker.go:90
+0x11e
github.com/apache/dubbo-go/filter/filter_impl.(*gracefulShutdownFilter).Invoke()
/root/go/pkg/mod/github.com/apache/[email protected]/filter/filter_impl/graceful_shutdown_filter.go:63
+0xb3
github.com/apache/dubbo-go/protocol/protocolwrapper.(*FilterInvoker).Invoke()
**What you expected to happen**:
相关代码:
// Invoke call remoting.
func (di *DubboInvoker) Invoke(ctx context.Context, invocation
protocol.Invocation) protocol.Result {
var (
err error
result protocol.RPCResult
)
if di.reqNum < 0 {
// Generally, the case will not happen, because the invoker has
been removed
// from the invoker list before destroy,so no new request will
enter the destroyed invoker
logger.Warnf("this dubboInvoker is destroyed")
result.Err = ErrDestroyedInvoker
return &result
}
atomic.AddInt64(&(di.reqNum), 1)
defer atomic.AddInt64(&(di.reqNum), -1)
竞态点:协程53使用原子写di.reqNum
协程1137未使用原子读di.reqNum
**How to reproduce it (as minimally and precisely as possible)**:
**Anything else we need to know?**:
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]