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

There is a change that a TCPServer may have accepted a new connection before the working thread pool started #30

Closed
zieckey opened this issue Apr 12, 2017 · 0 comments
Labels

Comments

@zieckey
Copy link
Collaborator

zieckey commented Apr 12, 2017

Time 1 : TCPServer::listener_::Listen
Time 2 : TCPServer::tpool_ is starting
Time 3 : A new connection is comming
Time 4 : TCPServer::HandleNewConn is invoked and we assert that
tpool_ must be running that would crash

@zieckey zieckey added the bug label Apr 12, 2017
zieckey added a commit that referenced this issue Apr 12, 2017
before the working thread pool started. Suppose that:

Time 1 : TCPServer::listener_::Listen
Time 2 : TCPServer::tpool_ is starting
Time 3 : A new connection is comming
Time 4 : TCPServer::HandleNewConn is invoked and we assert that
         tpool_ must be running that would crash

So we changed the implementation of Listener::Listen() to two method :
    Listen() and Accept()

And we invoke Listener::Listen() in TCPServer::Init() and then invoke
TCPServer::Start() where we start thread pool firstly, and after the
thread pool has started, we invoke Listener::Accept().

#30
@zieckey zieckey closed this as completed Apr 12, 2017
zieckey added a commit that referenced this issue Apr 27, 2017
before the working thread pool started. Suppose that:

Time 1 : TCPServer::listener_::Listen
Time 2 : TCPServer::tpool_ is starting
Time 3 : A new connection is comming
Time 4 : TCPServer::HandleNewConn is invoked and we assert that
         tpool_ must be running that would crash

So we changed the implementation of Listener::Listen() to two method :
    Listen() and Accept()

And we invoke Listener::Listen() in TCPServer::Init() and then invoke
TCPServer::Start() where we start thread pool firstly, and after the
thread pool has started, we invoke Listener::Accept().

#30
zieckey added a commit that referenced this issue May 20, 2017
before the working thread pool started. Suppose that:

Time 1 : TCPServer::listener_::Listen
Time 2 : TCPServer::tpool_ is starting
Time 3 : A new connection is comming
Time 4 : TCPServer::HandleNewConn is invoked and we assert that
         tpool_ must be running that would crash

So we changed the implementation of Listener::Listen() to two method :
    Listen() and Accept()

And we invoke Listener::Listen() in TCPServer::Init() and then invoke
TCPServer::Start() where we start thread pool firstly, and after the
thread pool has started, we invoke Listener::Accept().

#30
zieckey added a commit that referenced this issue May 20, 2017
before the working thread pool started. Suppose that:

Time 1 : TCPServer::listener_::Listen
Time 2 : TCPServer::tpool_ is starting
Time 3 : A new connection is comming
Time 4 : TCPServer::HandleNewConn is invoked and we assert that
         tpool_ must be running that would crash

So we changed the implementation of Listener::Listen() to two method :
    Listen() and Accept()

And we invoke Listener::Listen() in TCPServer::Init() and then invoke
TCPServer::Start() where we start thread pool firstly, and after the
thread pool has started, we invoke Listener::Accept().

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

No branches or pull requests

1 participant