ddtrace/tracer: reset payload after every transport attempt #319
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.
TODO
Change description
Previously, we were attempting to save the payload as long as the size
allows it in order to attempt and send it again on subsequent retries to
minimize the loss of traces.
This has proven to be a bad approach because there were cases where the
trace agent did only partial reads from the payload before failing,
leaving the payload in a state where it was impossible to decode using
msgpack (part of the buffer was already read).
This fix is an intermediary easy solution to the problem (we have
experimented with different approaches too, see #275). We can potentially
experiment later on with retry policies.
Closes #276