-
Notifications
You must be signed in to change notification settings - Fork 23
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
Sending an item larger than the buffer size leads to infinite loop #32
Comments
qxjit
added a commit
to qxjit/datadog
that referenced
this issue
May 14, 2019
Adds a length check to `send` that checks whether the metric being sent is longer than the max buffer size. An exception is raised to the caller (*not* in the reaper thread) if the metric is too large. In order to check the length before adding the item to the reaper thread, the UTF8 building had to move to be done in the calling thread rather than the background. Prior to this, if a chunk larger than the max buffer size made it into `builderAction` it would cause an infinite loop. It would try to flush existing chunks to make room for the new one, but would then get stuck because the oversize chunk was still too big. The exact same thing would happen on the next `builderAction` iteration (and so forth). Fixes iand675#32.
qxjit
added a commit
to qxjit/datadog
that referenced
this issue
May 15, 2019
Adds a length check to `send` that checks whether the metric being sent is longer than the max buffer size. An exception is raised to the caller (*not* in the reaper thread) if the metric is too large. In order to check the length before adding the item to the reaper thread, the UTF8 building had to move to be done in the calling thread rather than the background. Prior to this, if a chunk larger than the max buffer size made it into `builderAction` it would cause an infinite loop. It would try to flush existing chunks to make room for the new one, but would then get stuck because the oversize chunk was still too big. The exact same thing would happen on the next `builderAction` iteration (and so forth). Fixes iand675#32.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
send
with an item that encodes to bytes longer than the maximum buffer size results causeswithDogStatsD
to never return. It looks likebuilderAction
has no case for dealing with an individual chunk that is larger than the buffer size. Instead it dutifully flushes the chunks it has and tries to send the oversized chunk on the next iteration. Since the chunk is still too big, this leads to an infinite loop.withDogStatsD
will then get stuck when it tries to send the remaining unsent items.The text was updated successfully, but these errors were encountered: