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

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

Open
wavetylor opened this issue Oct 23, 2019 · 0 comments
Open

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

wavetylor opened this issue Oct 23, 2019 · 0 comments

Comments

@wavetylor
Copy link
Contributor

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
anuraaga pushed a commit that referenced this issue Oct 24, 2019
* Added null checks for the application spans due to internal requests made when s3 client is configured with enableForceGlobalBucketAccess()

* PR feedback: Prefer early return on null checks; Simplify testing with MockWebServer
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

No branches or pull requests

1 participant