Skip to content

Conversation

@xanec
Copy link
Contributor

@xanec xanec commented Oct 21, 2017

To fix #65

@xanec xanec requested a review from leventov October 21, 2017 00:57
FailedBuffer failedBuffer = failedBuffers.peekFirst();
if (failedBuffer != null) {
if (sendWithRetries(failedBuffer.buffer, failedBuffer.length, failedBuffer.eventCount)) {
if (sendWithRetries(failedBuffer.buffer, failedBuffer.length, failedBuffer.eventCount, false)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should enable timeout for at least the tryEmitOneFailedBuffer because if the emitting thread gets blocked on this, we may still have the situation of growing buffersToEmit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each individual retry is still timing out, so it's limited to approximately 3 timouts (because we do 3 retires), so buffers to emit could get ~ 3 more batches at this time

}
}

private long sendRequestTimeoutMillis()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we have these literals configuration, for example

com.metamx.emitter.http.httpTimeoutAllowanceFactor.level1 = 1.5
com.metamx.emitter.http.httpTimeoutAllowanceFactor.level2 = 0.9
com.metamx.emitter.http.httpTimeoutAllowanceFactor.level3 = 0.5

com.metamx.emitter.http.emitQueueThreshold.level1 = 5
com.metamx.emitter.http.emitQueueThreshold.level2 = 10

Or at least make them into constant values (e.g. private static final int EMIT_QUEUE_THRESHOLD1 = 5;, etc)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add constants, too much configs which nobody would know how to set right

@xanec
Copy link
Contributor Author

xanec commented Oct 26, 2017

LGTM 👍

@leventov leventov merged commit 73643f9 into master Oct 26, 2017
@leventov leventov deleted the HttpPostEmitter-timeout branch October 26, 2017 22:07
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

Successfully merging this pull request may close these issues.

Uncontrolled build up of buffers in HttpPostEmitter

3 participants