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

refactor: remove manual deletion of channel resources or objects #5633

Merged
merged 6 commits into from
Feb 1, 2023

Conversation

girishc13
Copy link
Contributor

@girishc13 girishc13 commented Jan 27, 2023

Goals:

  • resolves refactor: extract GrpcConnectionPool implementation into a package #5622
  • In the reset_connection method, the channel was being manually deleted using the del keyword which can cause segmentation fault if another co-routine was having a reference the deleted channel. The alternatives to avoid deleting the channel reference are:
    1. use a Lock to detect usage or
    2. allow the GC to collect the unused channel when all references have been removed.
  • The ii choice is more straight forward since the co-routines that maybe holding a channel are usually short lived due to the timeout on the request. Also destroying the channel has very little benefit because the underlying TCP connection will be reused or recreated by the new connection.
  • The removed channel doesn't need to be returned because there is no further usage.

@girishc13 girishc13 self-assigned this Jan 27, 2023
@github-actions github-actions bot added size/S area/core This issue/PR affects the core codebase area/testing This issue/PR affects testing labels Jan 27, 2023
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #5633 (79571b6) into master (02edb74) will increase coverage by 17.90%.
The diff coverage is 85.71%.

@@             Coverage Diff             @@
##           master    #5633       +/-   ##
===========================================
+ Coverage   70.38%   88.28%   +17.90%     
===========================================
  Files         129      131        +2     
  Lines       10179    10200       +21     
===========================================
+ Hits         7164     9005     +1841     
+ Misses       3015     1195     -1820     
Flag Coverage Δ
jina 88.28% <85.71%> (+17.90%) ⬆️

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

Impacted Files Coverage Δ
jina/clients/__init__.py 96.87% <ø> (+18.75%) ⬆️
jina/orchestrate/flow/base.py 89.62% <ø> (+11.26%) ⬆️
jina/serve/networking/replica_list.py 89.24% <80.00%> (+22.00%) ⬆️
jina/serve/networking/connection_pool_map.py 97.36% <100.00%> (+11.47%) ⬆️
jina/resources/health_check/pod.py 50.00% <0.00%> (ø)
jina/resources/health_check/gateway.py 41.17% <0.00%> (ø)
jina/orchestrate/pods/__init__.py 88.05% <0.00%> (+0.62%) ⬆️
jina/proto/pb2/jina_pb2_grpc.py 76.00% <0.00%> (+1.00%) ⬆️
jina/jaml/parsers/__init__.py 97.72% <0.00%> (+2.27%) ⬆️
jina/serve/gateway.py 95.31% <0.00%> (+3.12%) ⬆️
... and 73 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@girishc13 girishc13 marked this pull request as ready for review January 27, 2023 13:34
@girishc13
Copy link
Contributor Author

I opened a bug ticket related to custom logging configuration. The logging check using a FileHandler was one potential way to check the reconnect attempts. Due to multiprocessing using instrumentation might be the only other way.

@girishc13 girishc13 changed the title refactor: remove manual deletion of resources or objects refactor: remove manual deletion of channel resources or objects Feb 1, 2023
@girishc13 girishc13 closed this Feb 1, 2023
@girishc13 girishc13 reopened this Feb 1, 2023
@github-actions github-actions bot added size/M area/cli This issue/PR affects the command line interface area/docs This issue/PR affects the docs component/client labels Feb 1, 2023
@girishc13 girishc13 merged commit 19f2d21 into master Feb 1, 2023
@girishc13 girishc13 deleted the refactor-serve-5622-part-2 branch February 1, 2023 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli This issue/PR affects the command line interface area/core This issue/PR affects the core codebase area/docs This issue/PR affects the docs area/testing This issue/PR affects testing component/client size/M size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: extract GrpcConnectionPool implementation into a package
3 participants