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

Shutdown request handler before network server in ambry server #1206

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

justinlin-linkedin
Copy link
Collaborator

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 26, 2019

Codecov Report

Merging #1206 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ Complexity Δ
...main/java/com.github.ambry.server/AmbryServer.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...java/com.github.ambry.store/CompactionManager.java 87.33% <0%> (-2.67%) 19% <0%> (ø)
...github.ambry.rest/AsyncRequestResponseHandler.java 87.94% <0%> (-0.66%) 23% <0%> (ø)
...java/com.github.ambry.network/SSLTransmission.java 69.1% <0%> (-0.64%) 67% <0%> (-2%)
...va/com.github.ambry.replication/ReplicaThread.java 74.62% <0%> (-0.19%) 66% <0%> (-1%)
...src/main/java/com.github.ambry.commons/BlobId.java 93.54% <0%> (+0.35%) 72% <0%> (+1%) ⬆️
...in/java/com.github.ambry.network/SocketServer.java 84.01% <0%> (+0.4%) 15% <0%> (ø) ⬇️
...in/java/com.github.ambry.store/BlobStoreStats.java 71.54% <0%> (+0.61%) 104% <0%> (+1%) ⬆️
...b.ambry.network/BlockingChannelConnectionPool.java 70.42% <0%> (+0.93%) 8% <0%> (+1%) ⬆️
.../main/java/com.github.ambry.router/DecryptJob.java 97.22% <0%> (+5.55%) 5% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80c32e7...10d54c4. Read the comment docs.

@@ -219,12 +219,12 @@ public void shutdown() {
if (statsManager != null) {
statsManager.shutdown();
}
if (networkServer != null) {
networkServer.shutdown();
Copy link
Contributor

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)

Copy link
Collaborator Author

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.

@cgtz cgtz merged commit 063ca5e into linkedin:master Jul 29, 2019
@justinlin-linkedin justinlin-linkedin deleted the shutdown branch August 16, 2019 20:50
cgtz added a commit to cgtz/ambry that referenced this pull request Oct 4, 2019
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.
zzmao pushed a commit that referenced this pull request Oct 4, 2019
#1206)" (#1273)

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.
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