Skip to content

[PureGo] Add per-stream connections - #897

Merged
danilonajkov-db merged 2 commits into
mainfrom
effort/connection-mux
Oct 7, 2026
Merged

danilonajkov-db merged 2 commits into
mainfrom
effort/connection-mux

Conversation

@danilonajkov-db

@danilonajkov-db danilonajkov-db commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What changes are proposed in this pull request?

Issue #767 shows that PureGo's shared gRPC connection limits throughput when one SDK owns several ingestion streams. Add WithConnectionPerStream(enabled), matching the Rust and wrapper SDKs: each stream gets a dedicated gRPC connection by default, and WithConnectionPerStream(false) multiplexes all streams from an SDK over one shared connection.

Dedicated connections belong to their streams and close on stream teardown, including failed opens and SDK.Close. The shared connection belongs to the SDK and closes after its streams. The README and changelog explain the new option.

This follows the connection isolation direction explored in #821. Addresses #767.

How is this tested?

  • cd purego && go test ./...
  • cd purego && go test -race ./zerobus -run TestConnectionPerStreamModes -count=1

The local gRPC integration test checks that four streams use four TCP connections by default and one shared TCP connection when the option is false. It also verifies that closing one stream leaves another able to ingest and flush.

@danilonajkov-db danilonajkov-db changed the title [PureGo] Add bounded connection pool [PureGo] Add per-stream connections Oct 5, 2026
@danilonajkov-db
danilonajkov-db force-pushed the effort/connection-mux branch 2 times, most recently from c767b8a to 8f9b032 Compare October 5, 2026 15:34
elenagaljak-db

This comment was marked as outdated.

Comment thread purego/zerobus/sdk.go
Signed-off-by: danilo-najkov-db <danilo.najkov@databricks.com>

@elenagaljak-db elenagaljak-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice fix

@elenagaljak-db elenagaljak-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice fix

@danilonajkov-db
danilonajkov-db added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit 41762d8 Oct 7, 2026
20 checks passed
@danilonajkov-db
danilonajkov-db deleted the effort/connection-mux branch October 7, 2026 16:02
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