Royal-go opened a new issue, #1165:
URL: https://github.com/apache/rocketmq-client-go/issues/1165

   正常使用
   `    // 订阅topic
        err = mqConsumer.consumerIns.Subscribe(consumerTopic, 
consumer.MessageSelector{}, func(ctx context.Context, msgs 
...*primitive.MessageExt) (consumer.ConsumeResult, error) {
                for i := range msgs {
                        err2 := consumerLogic(ctx, msgs[i].Message.Body)
                        if err2 != nil {
                                return consumer.ConsumeRetryLater, err2
                        }
                }
                return consumer.ConsumeSuccess, nil
        })`
   
   出现异常:
   报错堆栈
   
   `fatal error: concurrent map iteration and map write
   
   goroutine 53584678 [running]:
   reflect.mapiternext(0x504509?)
           /jdk/go/src/runtime/map.go:1532 +0x13
   reflect.(*MapIter).Next(0xc004ce4a78?)
           /jdk/go/src/reflect/value.go:1989 +0x74
   internal/fmtsort.Sort({0x1677520?, 0xc007c6ca80?, 0xc004ce4cd0?})
           /jdk/go/src/internal/fmtsort/sort.go:59 +0x1a7
   fmt.(*pp).printValue(0xc008293450, {0x1677520?, 0xc007c6ca80?, 
0x7f7ac83521b0?}, 0x76, 0x0)
           /jdk/go/src/fmt/print.go:816 +0x988
   fmt.(*pp).printArg(0xc008293450, {0x1677520, 0xc007c6ca80}, 0x76)
           /jdk/go/src/fmt/print.go:759 +0x4bb
   fmt.(*pp).doPrintf(0xc008293450, {0x192885b, 0x3d}, {0xc004ce4fd0, 0x5, 0x5})
           /jdk/go/src/fmt/print.go:1074 +0x37e
   fmt.Sprintf({0x192885b, 0x3d}, {0xc004ce4fd0, 0x5, 0x5})
           /jdk/go/src/fmt/print.go:239 +0x53
   github.com/apache/rocketmq-client-go/v2/primitive.(*Message).String(...)
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/primitive/message.go:207
   
github.com/apache/rocketmq-client-go/v2/primitive.(*MessageExt).String(0xc0061fab40)
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/primitive/message.go:272
 +0x145
   fmt.(*pp).handleMethods(0xc00050b110, 0x615f378?)
           /jdk/go/src/fmt/print.go:673 +0x31f
   fmt.(*pp).printValue(0xc00050b110, {0x181cf40?, 0xc00615f378?, 0x51b4f0?}, 
0x76, 0x1)
           /jdk/go/src/fmt/print.go:770 +0xca
   fmt.(*pp).printValue(0xc00050b110, {0x15da780?, 0xc000637c50?, 
0xc004ce56b0?}, 0x76, 0x0)
           /jdk/go/src/fmt/print.go:910 +0x1585
   fmt.(*pp).printArg(0xc00050b110, {0x15da780, 0xc000637c50}, 0x76)
           /jdk/go/src/fmt/print.go:759 +0x4bb
   fmt.(*pp).doPrint(0xc00050b110, {0xc004ce5750?, 0x1, 0x1?})
           /jdk/go/src/fmt/print.go:1208 +0x45
   fmt.Sprint({0xc004ce5750, 0x1, 0x1})
           /jdk/go/src/fmt/print.go:279 +0x3e
   github.com/sirupsen/logrus.(*TextFormatter).appendValue(0xc00009fb00, 
0xc00397d710, {0x15da780?, 0xc000637c50?})
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:331
 +0x65
   github.com/sirupsen/logrus.(*TextFormatter).appendKeyValue(0xc00009fb00, 
0xc00397d710, {0x18dea2f?, 0x8?}, {0x15da780, 0xc000637c50})
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:325
 +0x94
   github.com/sirupsen/logrus.(*TextFormatter).Format(0xc00009fb00, 
0xc000318b60)
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/text_formatter.go:224
 +0xf71
   github.com/sirupsen/logrus.(*Entry).write(0xc000318b60)
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/entry.go:289 +0x94
   github.com/sirupsen/logrus.(*Entry).log(0xc000318af0, 0x3, {0xc00790cf80, 
0x1d})
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/entry.go:252 +0x425
   github.com/sirupsen/logrus.(*Entry).Log(0xc000318af0, 0x3, {0xc004ce5da0?, 
0xc004ce5db0?, 0x4716c5?})
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/entry.go:304 +0x48
   github.com/sirupsen/logrus.(*Entry).Warn(...)
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/entry.go:325
   github.com/sirupsen/logrus.(*Entry).Warning(...)
           
/usr/local/gopath/pkg/mod/github.com/sirupsen/[email protected]/entry.go:329
   
github.com/apache/rocketmq-client-go/v2/rlog.(*defaultLogger).Warning(0x1676b60?,
 {0x1901734, 0x1d}, 0xd?)
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/rlog/log.go:103
 +0x93
   github.com/apache/rocketmq-client-go/v2/rlog.Warning(...)
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/rlog/log.go:216
   
github.com/apache/rocketmq-client-go/v2/consumer.(*pushConsumer).consumeMessageConcurrently.func1()
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/push_consumer.go:1147
 +0x895
   github.com/apache/rocketmq-client-go/v2/primitive.WithRecover(0xc00005a9a0?)
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/primitive/base.go:100
 +0x33
   created by 
github.com/apache/rocketmq-client-go/v2/consumer.(*pushConsumer).consumeMessageConcurrently
 in goroutine 53570158
           
/usr/local/gopath/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/push_consumer.go:1106
 +0x1ac
   `


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

Reply via email to