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

test server restart #46

Open
ghost opened this issue Apr 26, 2016 · 1 comment
Open

test server restart #46

ghost opened this issue Apr 26, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 26, 2016

trying to test the server restart case with independent IOThreadPool Echo example. patch EchoClient to catch folly::AsyncSocketException in the while loop (receive input and write to pipeline), so the while loop keeps forever.

test steps like:

  1. start EchoServer
  2. start EchoClient, write “a”
  3. stop EchoServer
  4. write “a” again at Client, this write will fail.
  5. start EchoServer again.
  6. But EchoClient could not auto-recover the broken socket.

Firstly need the similar patch with issue 45, to keep the EventBase in ClientBootstrap and implement ~ClientBootstrap.

Tried to call client.connect() again in the exception handling. But assert, `eventBase_->isInEventBaseThread()’, may fail when destruct the previous pipeline inside ClientBootstrap, as IOThreadPool is set to 2 and ClientBootstrap.connect() may select a new thread for it.

Had to allocate a new ClientBootstrap or added the reconnect() function to ClientBootstrap, which used the saved EventBase in ClientBootstrap.connect() to setup connection again. Is it the correct way to handle the server process restart?

@djwatson
Copy link

Unfortunately the client side of the API was never fleshed out fully. The way finagle does this is to have a connection factory underneath the client, and yea make a new connection based on the eventbase

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

1 participant