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

[WIP]fix: shard queue panic #248

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jayantxie
Copy link
Member

@jayantxie jayantxie commented Apr 24, 2023

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):
由于root cause并非这个原因,暂时pending

(Optional) Which issue(s) this PR fixes:

cloudwego/kitex#913

(optional) The PR that updates user documentation:

@jayantxie jayantxie requested review from a team as code owners April 24, 2023 13:59
@jayantxie jayantxie force-pushed the fix/shrad_queue_panic branch 2 times, most recently from 34330bf to f98dffa Compare April 25, 2023 03:33
}

// MUST decrease bufNum first.
if atomic.AddInt32(&q.bufNum, negBufNum) <= 0 && atomic.LoadInt32(&q.state) != active {
Copy link
Contributor

Choose a reason for hiding this comment

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

这里为啥也要判断?

@jayantxie jayantxie changed the title fix: shard queue panic [WIP]fix: shard queue panic May 26, 2023
}
negBufNum -= int32(len(q.swap))

Choose a reason for hiding this comment

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

这里为什么是 -= len(q.swap) 呢? bufNum 每增加一次,对应的 shard 中不一定只写入了一个 getter 吧,这样似乎 negBufNum != -bufNum ?

另外请问下这份PR还会继续维护吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants