Skip to content

Commit ba6c9fc

Browse files
committed
fix lint
1 parent 843e991 commit ba6c9fc

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pulsar/producer_partition.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,14 +1274,18 @@ func (p *partitionProducer) ReceivedSendReceipt(response *pb.CommandSendReceipt)
12741274

12751275
if pi.sequenceID < response.GetSequenceId() {
12761276
// Force connection closing so that messages can be re-transmitted in a new connection
1277-
p.log.Warnf("Received ack for ledgerId:%d entryId:%d on sequenceId %v - expected: %v, local < remote, closing connection",
1278-
int64(*response.GetMessageId().LedgerId), int64(*response.GetMessageId().EntryId), response.GetSequenceId(), pi.sequenceID)
1277+
p.log.Warnf("Received ack for ledgerId:%d entryId:%d on sequenceId %v - expected: %v, local < remote, "+
1278+
"closing connection",
1279+
int64(*response.GetMessageId().LedgerId), int64(*response.GetMessageId().EntryId), response.GetSequenceId(),
1280+
pi.sequenceID)
12791281
p._getConn().Close()
12801282
return
12811283
} else if pi.sequenceID > response.GetSequenceId() {
12821284
// Ignoring the ack since it's referring to a message that has already timed out.
1283-
p.log.Warnf("Received ack for ledgerId:%d entryId:%d on sequenceId %v - expected: %v, local > remote, ignore it",
1284-
int64(*response.GetMessageId().LedgerId), int64(*response.GetMessageId().EntryId), response.GetSequenceId(), pi.sequenceID)
1285+
p.log.Warnf("Received ack for ledgerId:%d entryId:%d on sequenceId %v - expected: %v, local > remote, "+
1286+
"ignore it",
1287+
int64(*response.GetMessageId().LedgerId), int64(*response.GetMessageId().EntryId), response.GetSequenceId(),
1288+
pi.sequenceID)
12851289
return
12861290
} else {
12871291
// The ack was indeed for the expected item in the queue, we can remove it and trigger the callback

pulsar/producer_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,15 +2374,15 @@ func TestProducerSendDuplicatedMessages(t *testing.T) {
23742374
})
23752375
assert.NoError(t, err)
23762376
for i := 0; i < 3; i++ {
2377-
var seqId int64 = 0
2378-
msgId, err := testProducer.Send(context.Background(), &ProducerMessage{
2377+
var seqId int64
2378+
msgID, err := testProducer.Send(context.Background(), &ProducerMessage{
23792379
Payload: make([]byte, 1024),
23802380
SequenceID: &seqId,
23812381
})
23822382
assert.NoError(t, err)
2383-
assert.NotNil(t, msgId)
2384-
assert.Equal(t, int64(-1), msgId.LedgerID())
2385-
assert.Equal(t, int64(-1), msgId.EntryID())
2383+
assert.NotNil(t, msgID)
2384+
assert.Equal(t, int64(-1), msgID.LedgerID())
2385+
assert.Equal(t, int64(-1), msgID.EntryID())
23862386
}
23872387
testProducer.Close()
23882388
}

0 commit comments

Comments
 (0)