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

🐛 Attempt to avoid connection pool running out of connections #3947

Merged
merged 7 commits into from
Mar 7, 2023

Conversation

GitHK
Copy link
Contributor

@GitHK GitHK commented Mar 6, 2023

What do these changes do?

Connections pool slowly fills up and at some point connections run out. This instructs the remote webserver (aka: the sidecar's Uvicorn to close the connection after the request is over).

If this brings no benefits will replace the global client with a per sidecar client.

Related issue/s

How to test

Checklist

@GitHK GitHK self-assigned this Mar 6, 2023
@GitHK GitHK added a:director-v2 issue related with the director-v2 service changelog:🐛bugfix labels Mar 6, 2023
@GitHK GitHK added this to the Mithril milestone Mar 6, 2023
@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Merging #3947 (b75ab69) into master (5a04039) will increase coverage by 14.3%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3947      +/-   ##
=========================================
+ Coverage    71.9%   86.2%   +14.3%     
=========================================
  Files         898     126     -772     
  Lines       38439    6380   -32059     
  Branches      839       0     -839     
=========================================
- Hits        27643    5504   -22139     
+ Misses      10588     876    -9712     
+ Partials      208       0     -208     
Flag Coverage Δ
integrationtests ?
unittests 86.2% <100.0%> (+6.6%) ⬆️

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

Impacted Files Coverage Δ
...tor_v2/modules/dynamic_sidecar/api_client/_base.py 98.6% <100.0%> (+8.3%) ⬆️
...ules/dynamic_sidecar/docker_service_specs/proxy.py 53.8% <0.0%> (-46.2%) ⬇️
...modules/dynamic_sidecar/scheduler/_core/_events.py 62.0% <0.0%> (-34.7%) ⬇️
...s/dynamic_sidecar/scheduler/_core/_events_utils.py 56.0% <0.0%> (-34.4%) ⬇️
...v2/modules/dynamic_sidecar/docker_compose_specs.py 71.4% <0.0%> (-22.7%) ⬇️
...s/dynamic_sidecar/docker_service_specs/settings.py 41.5% <0.0%> (-22.7%) ⬇️
...r_v2/modules/dynamic_sidecar/api_client/_public.py 68.6% <0.0%> (-21.0%) ⬇️
...or_v2/modules/db/repositories/projects_networks.py 52.1% <0.0%> (-17.4%) ⬇️
...vice_director_v2/api/routes/running_interactive.py 81.2% <0.0%> (-12.5%) ⬇️
...es/dynamic_sidecar/docker_service_specs/sidecar.py 79.1% <0.0%> (-6.3%) ⬇️
... and 841 more

@GitHK GitHK marked this pull request as ready for review March 7, 2023 07:21
@GitHK GitHK requested review from sanderegg and pcrespov as code owners March 7, 2023 07:21
@GitHK GitHK requested a review from matusdrobuliak66 March 7, 2023 07:21
@codeclimate
Copy link

codeclimate bot commented Mar 7, 2023

Code Climate has analyzed commit b75ab69 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Mar 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.2% 0.2% Duplication

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

This sounds like a plausible solution to the saturation of connections we detected! thx

@GitHK GitHK enabled auto-merge (squash) March 7, 2023 08:58
@GitHK GitHK merged commit 67722c9 into ITISFoundation:master Mar 7, 2023
@GitHK GitHK deleted the pr-osparc-fix-connection-pool branch March 7, 2023 12:27
@pcrespov pcrespov mentioned this pull request Mar 23, 2023
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:director-v2 issue related with the director-v2 service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants