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

[grid] keep HttpClient alive until unused #12558 #12978

Merged
merged 12 commits into from
Nov 13, 2023
Merged

Conversation

joerg1985
Copy link
Member

@joerg1985 joerg1985 commented Oct 20, 2023

Description

The old implementation did close the HttpClient some minutes after access and did not check if the HttpClient has request still waiting for a response.

Motivation and Context

This did break long running requests, especially when the client has a high read timeout set.

Note: This PR might make #12975 even worse, as it will not close the http client and prevent the retry to send the command more often.

Note: This PR will also fix the broken get session url endpoint and uses it where ever it makes sense.
This might lead to issues when people are using a grid of mixed versions, but is this supported at all?

Note: This PR will also add more output when the JSON parser failed, as it was useful to debug the broken get session url endpoint and might be useful for other issues too. has been removed from the PR as requested.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@joerg1985
Copy link
Member Author

An alternative way to handle this might be to use a WeakReference in the cache and use a Cleaner to call .close there.
This could also be used in other areas like the ProxyWebsocketsIntoGrid where it is not easy to call .close after use.

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (573eee0) 57.52% compared to head (b606bad) 57.52%.
Report is 1 commits behind head on trunk.

❗ Current head b606bad differs from pull request most recent head af21b85. Consider uploading reports for the commit af21b85 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #12978   +/-   ##
=======================================
  Coverage   57.52%   57.52%           
=======================================
  Files          86       86           
  Lines        5299     5299           
  Branches      221      221           
=======================================
  Hits         3048     3048           
  Misses       2030     2030           
  Partials      221      221           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Can you please solve the conflict so we merge this?

@joerg1985
Copy link
Member Author

@diemol i have fixed it, the PR should have no conflicts left.

@diemol
Copy link
Member

diemol commented Nov 6, 2023

There are some failures in CI, do you know if they are related?

@titusfortner
Copy link
Member

latest on trunk broke the CI so that might be causing these failures.

@joerg1985
Copy link
Member Author

i am currently looking into it

@diemol diemol merged commit 600a614 into trunk Nov 13, 2023
1 check passed
@diemol diemol deleted the http-client-usage-counter branch November 13, 2023 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants