-
Notifications
You must be signed in to change notification settings - Fork 275
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
Shutdown request handler before network server in ambry server #1206
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1206 +/- ##
=========================================
Coverage 69.43% 69.43%
- Complexity 5510 5511 +1
=========================================
Files 432 432
Lines 33844 33844
Branches 4312 4312
=========================================
Hits 23501 23501
- Misses 9149 9150 +1
+ Partials 1194 1193 -1
Continue to review full report at Codecov.
|
@@ -219,12 +219,12 @@ public void shutdown() { | |||
if (statsManager != null) { | |||
statsManager.shutdown(); | |||
} | |||
if (networkServer != null) { | |||
networkServer.shutdown(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what will happen for the requests that are currently being handled by requestHandlerPool if networkServer is shutdown? I think from the client side, they should see the disconnect quickly, but we have to double check that the RequestHandlers won't error out if the network components are shut down (my guess is no since they communicate via queues, but still worth checking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some experiments on the server side are definitely needed.
All the communication between network server and the request handler is through a concurrent blocking queue, so you are right about that request handlers won't error out. After this change, what should be happening is that, when we shutdown the request handler, it will handle all the pending requests in the blocking queue and enqueue corresponding responses to yet another blocking queue. But all the requests received during that will not be handled at all (request handlers are shut down). And there is no guarantee that the responses will be sent out either. My thought on this change is that, it's probably going to gracefully handle some pending requests but not all.
Even w/o this change, the client should be notified fairly soon since the the server might just RST the connection. Either way, clients need to be aware of the sudden termination of the connections.
1d7a96b
to
10d54c4
Compare
linkedin#1206)" This reverts commit 063ca5e. We have some suspicions that the frontend may not be able to deal with this nicely if it is in the middle of writing to a socket.
No description provided.