Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Handle null or empty SQS messages and/or message attributes #2833

Merged
merged 11 commits into from
Oct 15, 2024

Conversation

nr-ahemsath
Copy link
Member

Resolves #2811.

The SQS wrapper is updated to check for:

  • A null list of messages
  • A empty list of messages
  • Null message attributes

before attempting to accept tracing headers from the message attributes.

The SQS integration tests are updated to:

  • Test configuring AWSConfigs.InitializeCollections either true (default) or false (the condition that surfaced this bug)
    • Distributed tracing across SQS queues is not expected to work when this is configured to be false
  • Test receiving an empty message
  • Verify no wrapper exceptions or application errors

@nr-ahemsath nr-ahemsath requested a review from a team as a code owner October 14, 2024 22:54
nrcventura
nrcventura previously approved these changes Oct 14, 2024
nrcventura
nrcventura previously approved these changes Oct 15, 2024
tippmar-nr
tippmar-nr previously approved these changes Oct 15, 2024
@tippmar-nr tippmar-nr dismissed stale reviews from nrcventura and themself via fbc96e8 October 15, 2024 20:54
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.31%. Comparing base (0a98da4) to head (fbc96e8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2833   +/-   ##
=======================================
  Coverage   81.31%   81.31%           
=======================================
  Files         460      460           
  Lines       29239    29239           
  Branches     3231     3231           
=======================================
  Hits        23777    23777           
  Misses       4669     4669           
  Partials      793      793           
Flag Coverage Δ
Agent 82.22% <ø> (ø)
Profiler 73.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ions/NewRelic.Agent.Extensions/AwsSdk/SqsHelper.cs 90.32% <ø> (ø)

@nr-ahemsath nr-ahemsath enabled auto-merge (squash) October 15, 2024 21:16
@nr-ahemsath nr-ahemsath merged commit 758b770 into main Oct 15, 2024
94 checks passed
@nr-ahemsath nr-ahemsath deleted the fix/handle-null-or-empty-messages-sqs branch October 15, 2024 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQSRequestHandler.ProcessResponse exceptions
4 participants