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

[SDK] Do not frequently create and destroy http client threads #3198

Merged
merged 17 commits into from
Dec 18, 2024

Conversation

xiehuc
Copy link
Contributor

@xiehuc xiehuc commented Dec 10, 2024

Fixes #3189

Changes

keep the background thread for a while and destroy only when it's free for 1 minute.
Just like the background thread in OTLP file exporter.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@xiehuc xiehuc requested a review from a team as a code owner December 10, 2024 12:04
Copy link

linux-foundation-easycla bot commented Dec 10, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

netlify bot commented Dec 10, 2024

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit 51553ae
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/676287c1df94cb0008f6ea15

@xiehuc xiehuc changed the title fix #3189, fix frequently create and destroy http client threads [EXT] fix frequently create and destroy http client threads Dec 10, 2024
Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.83%. Comparing base (d9ad23e) to head (51553ae).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3198   +/-   ##
=======================================
  Coverage   87.83%   87.83%           
=======================================
  Files         195      195           
  Lines        6154     6154           
=======================================
  Hits         5405     5405           
  Misses        749      749           

@owent owent changed the title [EXT] fix frequently create and destroy http client threads [WIP] Fix #3189, fix frequently create and destroy http client threads Dec 10, 2024
@xiehuc xiehuc changed the title [WIP] Fix #3189, fix frequently create and destroy http client threads [WIP] fix frequently create and destroy http client threads Dec 10, 2024
@xiehuc xiehuc changed the title [WIP] fix frequently create and destroy http client threads [WIP] not frequently create and destroy http client threads Dec 12, 2024
@xiehuc xiehuc changed the title [WIP] not frequently create and destroy http client threads [WIP] do not frequently create and destroy http client threads Dec 12, 2024
Copy link
Member

@owent owent left a comment

Choose a reason for hiding this comment

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

LGTM and thanks for your contribution.

@owent owent changed the title [WIP] do not frequently create and destroy http client threads do not frequently create and destroy http client threads Dec 12, 2024
@marcalff marcalff changed the title do not frequently create and destroy http client threads [EXPORTER] Do not frequently create and destroy http client threads Dec 16, 2024
@marcalff marcalff changed the title [EXPORTER] Do not frequently create and destroy http client threads [SDK] Do not frequently create and destroy http client threads Dec 17, 2024
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

See minor comments about missing wakeupBackgroundThread(), will approve once fixed.

ext/src/http/client/curl/http_client_curl.cc Show resolved Hide resolved
@marcalff
Copy link
Member

CI failures in functional tests are unrelated, it also fails in main.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@marcalff marcalff merged commit 2b9bff9 into open-telemetry:main Dec 18, 2024
57 checks passed
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.

[HTTP Client] Reduce the frequency of creating and destroying background threads in HTTP Client.
4 participants