Skip to content

feat: create a generic wrapper for gRPC and REST pure background thre…#16154

Open
bajajneha27 wants to merge 2 commits into
googleapis:mainfrom
bajajneha27:generic-background-thread
Open

feat: create a generic wrapper for gRPC and REST pure background thre…#16154
bajajneha27 wants to merge 2 commits into
googleapis:mainfrom
bajajneha27:generic-background-thread

Conversation

@bajajneha27

Copy link
Copy Markdown
Contributor

…ad impl

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the background thread creation logic by introducing a generic template class, AutomaticallyCreatedBackgroundThreadsImpl, to consolidate duplicate code from both gRPC and REST background thread implementations. However, the reviewer identified a critical issue where this generic implementation breaks REST pure background threads due to invalid default-construction of RestPureCompletionQueue and the omission of internal::CallContext setup. To resolve this, the reviewer suggested introducing a customizable QueueTraits template parameter to handle queue-specific initialization and execution logic.

Comment thread google/cloud/internal/generic_background_threads_impl.h Outdated
Comment thread google/cloud/internal/rest_pure_background_threads_impl.h
Comment thread google/cloud/internal/rest_pure_background_threads_impl.h Outdated
@bajajneha27 bajajneha27 marked this pull request as ready for review June 12, 2026 12:25
@bajajneha27 bajajneha27 requested a review from a team as a code owner June 12, 2026 12:25
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.94595% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.21%. Comparing base (e908d88) to head (b36200c).

Files with missing lines Patch % Lines
...e/cloud/internal/generic_background_threads_impl.h 89.65% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16154   +/-   ##
=======================================
  Coverage   92.20%   92.21%           
=======================================
  Files        2264     2264           
  Lines      209084   209097   +13     
=======================================
+ Hits       192791   192813   +22     
+ Misses      16293    16284    -9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant