We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c77d58e + 0574d20 commit 2bc29e6Copy full SHA for 2bc29e6
examples/transactions/eos/main.go
@@ -75,7 +75,8 @@ func inputProducer() {
75
for i := 0; i < 10; i++ {
76
cl.Produce(ctx, kgo.StringRecord(msg+strconv.Itoa(i)), e.Promise())
77
}
78
- commit := kgo.TransactionEndTry(doCommit && e.Err() == nil)
+ perr := e.Err() // always evaluate e.Err() to ensure we do not short circuit in the logic below (doCommit && ... would fail if doCommit is false!)
79
+ commit := kgo.TransactionEndTry(doCommit && perr == nil)
80
81
switch err := cl.EndTransaction(ctx, commit); err {
82
case nil:
0 commit comments