gunli commented on PR #1249: URL: https://github.com/apache/pulsar-client-go/pull/1249#issuecomment-2244173223
> @gunli @RobertIndie The `runEventsLoop` can be stopped, when the producer is closed. > > Event: > > * reconnect request > This method already checks the producer state: https://github.com/apache/pulsar-client-go/blob/v0.13.0/pulsar/producer_partition.go#L468 > * send and close request > Close methods will close the `dataChan` and `cmdChan`, the event loop can check this close status: > > * https://github.com/apache/pulsar-client-go/blob/v0.13.0/pulsar/producer_partition.go#L547 > * https://github.com/apache/pulsar-client-go/blob/v0.13.0/pulsar/producer_partition.go#L553 But the behavior is unpredictable as they are run in different goroutines, after `doClose()` update the `state` to `closing`, `reconnecting()` will return immediately, but now `dataChan` and `cmdChan` are not closed yet, neither the batchFlushTicker, the event loop will coninue to run, it can still run into `internalSend()` and `internalFlushCurrentBatch()`. -- 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]
