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

Fix: cpu 100% in session.handleLoop #24

Merged
merged 6 commits into from
Sep 5, 2019
Merged

Conversation

pantianying
Copy link
Member

No description provided.

@AlexStocks AlexStocks changed the title change grNum to chan Fix: cpu 100% in handleTcpPackage Sep 3, 2019
@AlexStocks AlexStocks changed the title Fix: cpu 100% in handleTcpPackage Fix: cpu 100% in session.handleLoop Sep 3, 2019
Copy link

@fangyincheng fangyincheng left a comment

Choose a reason for hiding this comment

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

LGTM

@wongoo
Copy link

wongoo commented Sep 4, 2019

Is this PR really fix cpu 100% issue?
The info I got is that the value of s.grNum not changing to 1 causes handleLoop() can not break and go into a dead loop. is it correct?
And the community performance test result says that handlePackage may blocked on read and won't exit. Is that correct?

@AlexStocks
Copy link

Is this PR really fix cpu 100% issue?
The info I got is that the value of s.grNum not changing to 1 causes handleLoop() can not break and go into a dead loop. is it correct?
And the community performance test result says that handlePackage may blocked on read and won't exit. Is that correct?

Yes, it is for cpu 100% bug fix. The session.handleLoop will run very quickly when the ss.Done is closed but the done select branch can not block when the handlePackage has not exited. And panty add the session.rDone to let the session.handleLoop for-select-done branch block on '<-session.rDone'.

the "handlePackage may blocked on read and won't exit." case is that the handlePackage will try to reconnect the server when it invokes the session.stop(). At last it will exit when it connects the server successfully or this session is closed by upper invoker. However, this case does not matter because it should not block the handleLoop to wait.

@AlexStocks
Copy link

LGTM

1 similar comment
@wongoo
Copy link

wongoo commented Sep 5, 2019

LGTM

@wongoo wongoo merged commit 6de78d9 into apache:master Sep 5, 2019
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.

4 participants