dsmlily opened a new issue #151: consumer.Subscribe() blocked after the "Short read when reading frame size" error happend URL: https://github.com/apache/pulsar-client-go/issues/151 #### Steps to reproduce ##### 1、code ``` func main(){ client, err := pulsar.NewClient(pulsar.ClientOptions{ URL: "pulsar://10.32.32.20:6650", ConnectionTimeout:time.Second * time.Duration(2), OperationTimeout: time.Second * time.Duration(2), }) if err != nil { log.Fatal(err) } GConsumerClient = client wg := sync.WaitGroup{} defer client.Close() for i := 0; i < 20; i++ { index := i time.Sleep(time.Second*2) roomId := strconv.Itoa(index) subscriptionName := fmt.Sprintf("sub-name-%s", roomId) c, e := initRoomPulsarConsumer(roomId,subscriptionName) if e != nil { fmt.Printf("create faild -- %d\n", index) //wg.Done() //log.Fatal(e) continue } time.Sleep(time.Second*1) wg.Add(1) go func(con pulsar.Consumer,sb string) { fmt.Printf("to close room %s.....\n",sb) err := con.Unsubscribe() if err != nil { fmt.Printf("******* Unsubscribe error %s.....\n",err.Error()) } con.Close() fmt.Printf("to close room [%s close done***]\n",sb) wg.Done() }(c,subscriptionName) fmt.Printf("wait group -- %d done\n", index) } wg.Wait() } func initRoomPulsarConsumer(roomId string, subscriptionName string) (consumer pulsar.Consumer, err error) { fmt.Printf("to creat room consumer SubscriptionName:%s .....\n",subscriptionName) cfg := pulsar.ConsumerOptions{ Topic: fmt.Sprintf("dev_pid2/signal_geo/%s", roomId), SubscriptionName: subscriptionName, Type: pulsar.Failover, } consumer, err = GConsumerClient.Subscribe(cfg) if err != nil { fmt.Printf("***** could not establish subscription %v, err: %s", roomId, err.Error()) return nil, err } fmt.Printf("creat room consumer done, SubscriptionName:%s ***creat done\n",cfg.SubscriptionName) return } ``` ##### 2、Screenshot  #### System configuration **Pulsar version**: 2.4.0
---------------------------------------------------------------- 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] With regards, Apache Git Services
