Skip to content

Conversation

@karakanb
Copy link
Contributor

Replaced errgroup.Group with conc.Pool and reduced BigQuery pool sizes to decrease Kubernetes API call frequency and improve concurrency control.

The change to conc.Pool with explicit goroutine limits (2 for pipe consumption, 4 for BigQuery) provides more granular control over concurrency, directly addressing the issue of hitting the Kubernetes API too frequently. Additionally, the error handling order for command execution and pipe consumption was standardized across claudecode, python, and r runners to ensure pipes are fully read before the command exits, preventing potential deadlocks.


Linear Issue: BRU-3433

Open in Cursor Open in Web

This commit addresses issue BRU-3433 to reduce API call frequency:

- Replace errgroup.Group with conc.Pool in claudecode, python, and r packages
- Use WithMaxGoroutines(2).WithErrors() for pipe consumption (stdout/stderr)
- Reduce BigQuery pool sizes from max(runtime.NumCPU(), 8) to min(runtime.NumCPU(), 4)
- Fix r/runner.go to wait for pipe consumption before cmd.Wait() (matching python/local.go pattern)

The conc.Pool package provides better control over goroutine limits and
the reduced pool sizes help prevent hitting API rate limits too frequently.

Co-authored-by: burak.karakan <burak.karakan@gmail.com>
@cursor
Copy link

cursor bot commented Jan 16, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants