tisonkun commented on code in PR #1118:
URL: https://github.com/apache/pulsar-client-go/pull/1118#discussion_r1370165007
##########
pulsar/producer_partition.go:
##########
@@ -1446,6 +1431,22 @@ type sendRequest struct {
reservedMem int64
}
+func (sr *sendRequest) done(msgID MessageID, err error) {
+ sr.callbackOnce.Do(func() {
+ runCallback(sr.callback, msgID, sr.msg, err)
+ })
+
+ if sr.transaction != nil {
+ sr.transaction.endSendOrAckOp(err)
+ }
+
+ if sr.totalChunks <= 1 || sr.chunkID == sr.totalChunks-1 {
Review Comment:
In @gunli's PR, all these three lines are in this if block. I defer this
change until we really need it.
@gunli may you provide some background why we need to call `runCallback` and
`endSendOrAckOp` with this condition?
--
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]