Skip to content

[Bug] DATA RACE #1014

@tianping526

Description

@tianping526

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Programming Language of the Client

Go

Runtime Platform Environment

Image: ubuntu-24.04
Version: 20250602.3.0

RocketMQ Version of the Client/Server

github.com/apache/rocketmq-clients/golang/v5 v5.1.2

Run or Compiler Version

go 1.24.1

Describe the Bug

WARNING: DATA RACE
Read at 0x00c000554c50 by goroutine 18:
  github.com/apache/rocketmq-clients/golang/v5.(*defaultClientMeterProvider).isEnabled()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/metric.go:168 +0x2c
...
Previous write at 0x00c000554c50 by goroutine 384:
  github.com/apache/rocketmq-clients/golang/v5.(*defaultClientMeterProvider).Reset()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/metric.go:185 +0xb2c
...

WARNING: DATA RACE
Read at 0x00c000aa1080 by goroutine 18:
  sync/atomic.LoadInt32()
      /usr/local/go/src/runtime/race_amd64.s:202 +0xb
  sync/atomic.LoadUint32()
      <autogenerated>:1 +0x10
  github.com/apache/rocketmq-clients/golang/v5.(*defaultMessageMeterInterceptor).doAfter()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/metric.go:[156]
...
Previous write at 0x00c000aa1080 by goroutine 384:
  github.com/apache/rocketmq-clients/golang/v5.init.func5()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/metric.go:100 +0x58
  github.com/apache/rocketmq-clients/golang/v5.(*defaultClientMeterProvider).Reset()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/metric.go:185 +0xb17
...

WARNING: DATA RACE
Read at 0x00c000143438 by goroutine 18:
  github.com/apache/rocketmq-clients/golang/v5.(*defaultProducer).takeMessageQueues()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/producer.go:82 +0xb1
  github.com/apache/rocketmq-clients/golang/v5.(*defaultProducer).send0()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/producer.go:329 +0xa1b
  github.com/apache/rocketmq-clients/golang/v5.(*defaultProducer).getPublishingTopicRouteResult()
      /go/pkg/mod/github.com/apache/rocketmq-clients/golang/[email protected]/producer.go:92 +0xfc
  github.com/apache/rocketmq-clients/golang/v5.(*defaultProducer).send0()
...
Previous write at 0x00c000143438 by goroutine 180:
  sync/atomic.StoreInt32()
      /usr/local/go/src/runtime/race_amd64.s:231 +0xb
  sync/atomic.StoreUint32()
      <autogenerated>:1 +0x14
  internal/sync.(*HashTrieMap[go.shape.interface {},go.shape.interface {}]).initSlow()
      /usr/local/go/src/internal/sync/hashtriemap.go:55 +0x166
  internal/sync.(*HashTrieMap[go.shape.interface {},go.shape.interface {}]).init()
      /usr/local/go/src/internal/sync/hashtriemap.go:32 +0x46
  internal/sync.(*HashTrieMap[go.shape.interface {},go.shape.interface {}]).LoadAndDelete()
      /usr/local/go/src/internal/sync/hashtriemap.go:310 +0x64
  sync.(*Map).LoadAndDelete()
      /usr/local/go/src/sync/hashtriemap.go:73 +0x44
  github.com/apache/rocketmq-clients/golang/v5.(*defaultClient).doHeartbeat()
...

Steps to Reproduce

go test -race

What Did You Expect to See?

No DATA RACE

What Did You See Instead?

DATA RACE

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalePull request is staletype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions