Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactoring of
httpurlconnection
instrumentation due to several bugs discovered.Behavior expected when
HttpURLConnection
APIs are called in different combos and orders after the refactoring.connect
is called, then NO request is made over the wire and NO external call is reported. The instrumentation starts aTimerTask
ifconnect
is called first, waits for a set period of time (currently configured to be 1 minute) to determine if any furtherHttpURLConnection
APIs are called before deciding how to proceed. If no other API is called, then the segment is just ignored and no external is reported. If any other method is called an external call will be recorded.getOutputStream
,getInputStream
,getResponseCode
, orgetHeaderFields
all result in an external call being recorded.Fixes: #1091
It should also address these related issues:
https://issues.newrelic.com/browse/NEWRELIC-3496
https://issues.newrelic.com/browse/NR-70183
The
externals.py
AIT failures will pass when this PR is merged: https://github.com/newrelic/java-agent-integration-tests/pull/138