-
Notifications
You must be signed in to change notification settings - Fork 277
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
Restricting sender queue size #1132
Conversation
this(api, new NoopMonitor(), disruptorSize, senderQueueSize, flushFrequencySeconds); | ||
} | ||
|
||
// DQH - TODO - Update the tests & remove this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably end-up taking out the TODO for now.
However, I do think we need to find a better way to construct test objects.
I'd suggest creating finer grained Config objects with a Builder that works for both the Config & the object.
8f1ec67
to
c71cec5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor question, but looks good otherwise.
dd-trace-ot/src/main/java/datadog/trace/common/writer/DDAgentWriter.java
Show resolved
Hide resolved
To prevent unbounded memory consumption, restricting the size of the sender queue. Also, lowering the size of the Disruptor queue. Unfortunately, our choice of a ScheduledExecutorService makes this a bit difficult, since ScheduledExecutorService doesn't allow us to supply the queue. A bigger change is in-order but for now, this change restricts the queue size by introducing a Semaphore around the ScheduledExecutorService. In effort to making testing easier, I introduced Monitor.onFlush. This is used in the new slow response test which attempts to simulate a situation where the sending queue would back up.
Improving the reliability of the slow sender test. Still needs work, but to make this truly reliable, I'd need to add to the DDAgentWriter API. I'll probably do that, but I'm trying to start with sticking to the existing API.
f4ed2e0
to
c614df7
Compare
Adding call to monitor.onFailedSend in case senderSemaphore acquisition is interrupted during shutdown
To prevent unbounded memory consumption, restricting the size of the sender queue. Also, lowering the size of the Disruptor queue.
Unfortunately, our choice of a ScheduledExecutorService makes this a bit difficult, since ScheduledExecutorService doesn't allow us to supply the queue.
A bigger change is in-order but for now, this change restricts the queue size by introducing a Semaphore around the ScheduledExecutorService.
In effort to making testing easier, I introduced Monitor.onFlush. This is used in the new slow response test which attempts to simulate a situation where the sending queue would back up.
To my chagrin, the current test doesn't fail reliably when the queue is unbounded; however, it does fail.