Skip to content

NullPointers in aws-java-sdk-core in s3 clients #147

@wavetylor

Description

@wavetylor

The TracingRequestHandler in brave-instrumentation/aws-java-sdk-core can throw NPE due to an application span not being present in both the beforeAttempt and afterAttempt callback.

The root cause here is the s3 client executes a stealth HEAD request for many of the operations like CreateBucket, doesBucketExistV2 to do some preliminary checking and caching. Unfortunately, these HEAD requests do not invoke beforeExecution so an application span is never created for them, but they do invoke beforeAttempt.

This means the overall aws-sdk span isn't available and results in the NPE.

A couple of options:

  • Capture the head request and correctly map it to its parent. I'm not sure this is possible with what the callback provides.
  • ignore requests that don't have the span from beforeExecution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions