Skip to content

bugfix: fix decode instance infinite retry allocate.#1045

Open
magicheng0816 wants to merge 1 commit intojd-opensource:mainfrom
magicheng0816:fix_d_infinite_retry_allocate
Open

bugfix: fix decode instance infinite retry allocate.#1045
magicheng0816 wants to merge 1 commit intojd-opensource:mainfrom
magicheng0816:fix_d_infinite_retry_allocate

Conversation

@magicheng0816
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a fix for a potential infinite retry loop when a decode instance fails to allocate resources. It adds a retry limit for requests that are rejected. The overall logic is sound and effectively addresses the bug. I've provided one suggestion to optimize the locking mechanism in the retry logic to reduce lock contention and improve performance by consolidating two separate lock acquisitions into a single critical section.


// Max retries when D returns 404 (e.g. try_allocate failed), avoid infinite
// retry.
static constexpr int kAddNewRequestsMaxRetryOnReject = 3;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

int ==> int32_t or int64_t

Copy link
Copy Markdown
Collaborator

@yq33victor yq33victor left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants