Skip to content
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

Add max request count limit for LiCombinedControlRequest #519

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ class RequestSendThread(val controllerId: Int,

private var firstUpdateMetadataWithPartitionsSent = false

private val maxRequestCountToMerge = 100

@volatile private var latestRequestStatus = LatestRequestStatus(isInFlight = false, isInQueue = false, 0)

// This metric reports the queued time of the latest request from the queue
Expand Down Expand Up @@ -358,10 +360,14 @@ class RequestSendThread(val controllerId: Int,
// one concurrent access case considering the producer of the queue:
// an item is put to the queue right after the condition check below.
// That behavior does not change correctness since the inserted item will be picked up in the next round
while (!queue.isEmpty && shouldContinueMerging) {
// Fixme: tmp fix for incident-1517. We tried to merge limited amount of requests to a single LiCombinedControlRequest
// so that a single request size is not larger than max limit which is 100MB.
var counter = maxRequestCountToMerge
while (!queue.isEmpty && shouldContinueMerging && maxRequestCountToMerge > 0) {

Choose a reason for hiding this comment

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

This is a do-nothing change because maxRequestCountToMerge is always > 0. You want counter in there.

Copy link
Author

Choose a reason for hiding this comment

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

Haha good call! Thanks Greg!

// Continue merging if the item taken from the queue is a
// control request and has set `shouldContinueMerging` to true
shouldContinueMerging = takeFromQueueAndMerge().exists(_._2)
counter = counter - 1
}

val requestBuilder = controllerRequestMerger.pollLatestRequest()
Expand Down
Loading