Skip to content

Commit e905254

Browse files
committed
Fix the aws_s3 input warning for missing files
This is a refinement of the fix in #3221. I somehow missed that the warning message would only get printed for a single discovered object since we could get multiple paths from SQS, but we only send a single ack after all the objects are processed. Signed-off-by: Mihai Todor <todormihai@gmail.com>
1 parent 50f9595 commit e905254

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

internal/impl/aws/input_s3.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,7 @@ func (s *sqsTargetReader) readSQSEvents(ctx context.Context) ([]*s3ObjectTarget,
583583
keyNotFound := false
584584
if apiErr := smithy.APIError(nil); errors.As(err, &apiErr) {
585585
if _, ok := apiErr.(*s3types.NoSuchKey); ok {
586+
s.log.Warnf("Dropping SQS notification for missing key %q: %s", object.key, err)
586587
keyNotFound = true
587588
}
588589
}
@@ -603,9 +604,6 @@ func (s *sqsTargetReader) readSQSEvents(ctx context.Context) ([]*s3ObjectTarget,
603604
} else {
604605
ackOnce.Do(func() {
605606
if atomic.AddInt32(&pendingAcks, -1) == 0 {
606-
if keyNotFound {
607-
s.log.Warnf("Dropping SQS notification for missing key %q: %s", object.key, err)
608-
}
609607
aerr = s.ackSQSMessage(ctx, sqsMsg)
610608
}
611609
})

0 commit comments

Comments
 (0)