Skip to content

fix(pubsub): remove unnecessary worker spawn#4444

Merged
PhongChuong merged 1 commit intogoogleapis:mainfrom
PhongChuong:pubsubOrInsert
Jan 29, 2026
Merged

fix(pubsub): remove unnecessary worker spawn#4444
PhongChuong merged 1 commit intogoogleapis:mainfrom
PhongChuong:pubsubOrInsert

Conversation

@PhongChuong
Copy link
Copy Markdown
Collaborator

The codeblock in or_insert is always evaluated, use or_insert_with instead which is only evaluated when the ordering key does not already exist.

Fixes: #4443

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Jan 29, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (c5b69aa) to head (ff69c09).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4444      +/-   ##
==========================================
+ Coverage   95.03%   95.04%   +0.01%     
==========================================
  Files         194      194              
  Lines        7372     7372              
==========================================
+ Hits         7006     7007       +1     
+ Misses        366      365       -1     

☔ View full report in Codecov by Sentry.
📢 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.

@PhongChuong PhongChuong marked this pull request as ready for review January 29, 2026 15:26
@PhongChuong PhongChuong requested a review from a team January 29, 2026 15:26
@PhongChuong PhongChuong merged commit 90873cc into googleapis:main Jan 29, 2026
31 checks passed
@PhongChuong PhongChuong deleted the pubsubOrInsert branch February 19, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pubsub Publisher spawning extra BatchWorkers

2 participants