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

counter bug in session.go handleLoop() function #32

Closed
chinaerserver opened this issue Mar 23, 2020 · 3 comments
Closed

counter bug in session.go handleLoop() function #32

chinaerserver opened this issue Mar 23, 2020 · 3 comments

Comments

@chinaerserver
Copy link
Contributor

in handleLoop() function select case <-s.done: branch

counter.Start()
if counter.Count() > s.wait.Nanoseconds() {
  log.Info("%s, [session.handleLoop] got done signal ", s.Stat())
  break LOOP
}

if counter doesn't reach session exit waiting time , this if-branch will not hit so it cannot break loop.
however close(s. done) will tigger only once, if for-loop continue running ,case <-s.done will never reach.
so exit wait delay will not perform as expected.

In my opinion, judging exit waiting timeout should appear in select default case or using while counter.Count() > s.wait.Nanoseconds() {} to confirm timeout exit as expected.

@AlexStocks
Copy link
Owner

cc @watermelo @fangyincheng . pls check it.

@chinaerserver
Copy link
Contributor Author

I am worried about that in handleLoop() function if using writer encode pkg fail ,why still loop and doing nothing? Why not panic to stop for-looping

@Enan01
Copy link

Enan01 commented Jan 25, 2021

I am worried about that in handleLoop() function if using writer encode pkg fail ,why still loop and doing nothing? Why not panic to stop for-looping

I also want to know why?

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

No branches or pull requests

3 participants