BewareMyPower commented on code in PR #1310:
URL: https://github.com/apache/pulsar-client-go/pull/1310#discussion_r1855718589
##########
pulsar/consumer_partition.go:
##########
@@ -1133,6 +1138,15 @@ func (pc *partitionConsumer) internalAckList(request
*ackListRequest) {
}
func (pc *partitionConsumer) MessageReceived(response *pb.CommandMessage,
headersAndPayload internal.Buffer) error {
+ defer func() {
+ if r := recover(); r != nil {
+ if err, ok := r.(error); ok && err.Error() == "send on
closed channel" {
+ pc.log.WithField("panic", r).Debug("panic
recovered in MessageReceived")
Review Comment:
I removed this part because it should not reach here. If it reached here, it
means `MessageReceived` is called on a closed `partitionConsumer`, which does
not make sense because the consumer should unregister itself from the
connection.
So I'd like to fail fast rather than recovering from the panic and print a
warning message.
--
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]