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

Stop TCP interfaces and RPC connections on shutdown #3307

Merged
merged 2 commits into from
May 9, 2022
Merged

Stop TCP interfaces and RPC connections on shutdown #3307

merged 2 commits into from
May 9, 2022

Conversation

mkykadir
Copy link
Contributor

@mkykadir mkykadir commented Apr 18, 2022

Towards a better shutdown procedure

This will reduce the number of eventcore leaks during shutdown, only DNS UDP connection will be remaining as leaking.

Part of #3158

depends on #3311 and bosagora/localrest#6

@@ -59,13 +59,23 @@ shared static this ()
/// And implementation of `agora.network.Manager : NetworkManager` using Vibe.d
public final class VibeNetworkManager : NetworkManager
{
private RPCClient!(agora.api.Validator.API)[] rpc_clients;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant we just close() the socket in RPCClient dtor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all interface and connections should be closed before invoking node's shutdown procedure. But this might cause holding an unnecessary reference for cases where a connection is banned . I will think a better approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it with new approach, ready to review

@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

Merging #3307 (ffb3747) into v0.x.x (3ad1781) will increase coverage by 1.04%.
The diff coverage is 67.74%.

@@            Coverage Diff             @@
##           v0.x.x    #3307      +/-   ##
==========================================
+ Coverage   87.88%   88.92%   +1.04%     
==========================================
  Files         164      165       +1     
  Lines       16975    17108     +133     
==========================================
+ Hits        14918    15213     +295     
+ Misses       2057     1895     -162     
Flag Coverage Δ
integration 37.14% <60.00%> (+0.29%) ⬆️
unittests 87.73% <46.15%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
source/agora/api/FullNode.d 100.00% <ø> (ø)
source/agora/node/FullNode.d 74.10% <ø> (+2.08%) ⬆️
source/agora/network/Client.d 86.88% <50.00%> (-1.26%) ⬇️
source/agora/network/Manager.d 77.28% <50.00%> (+0.60%) ⬆️
source/agora/network/RPC.d 54.36% <50.00%> (+52.34%) ⬆️
source/agora/node/main.d 45.94% <60.00%> (ø)
source/agora/network/VibeManager.d 50.00% <100.00%> (+48.55%) ⬆️
source/agora/test/Base.d 80.88% <100.00%> (+0.18%) ⬆️
source/agora/script/Engine.d 97.34% <0.00%> (-0.15%) ⬇️
... and 13 more

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 3ad1781...ffb3747. Read the comment docs.

Copy link
Contributor

@hewison-chris hewison-chris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hewison-chris hewison-chris merged commit 09895d4 into bosagora:v0.x.x May 9, 2022
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.

3 participants