Skip to content

feat(go): parse iggy:// connection strings into TCP client options - #4497

Open
choksi2212 wants to merge 10 commits into
apache:masterfrom
choksi2212:feat/go-connection-string-4491
Open

choksi2212 wants to merge 10 commits into
apache:masterfrom
choksi2212:feat/go-connection-string-4491

Conversation

@choksi2212

Copy link
Copy Markdown

Which issue does this PR address?

Closes #4491

Rationale

The Rust, Node and C# SDKs all accept iggy:// connection strings; the Go SDK had no parser, so Go users built the TCP options by hand. This adds ParseConnectionString per the issue spec, returning the existing options from tcp_core.go so the result drops straight into client.WithTcp.

What changed?

  • New foreign/go/client/connection_string.go with func ParseConnectionString(connectionString string) ([]tcp.Option, error).
  • Accepts iggy:// and iggy+tcp://; other iggy+<transport> schemes are rejected.
  • Credentials: username:password or a single personal access token before the @, wired into WithAutoLogin via NewUsernamePasswordCredentials / NewPersonalAccessTokenCredentials. No new credential or TLS types were added.
  • Host: host:port and bracketed IPv6 ([::1]:8090), validated with net.SplitHostPort plus a u16 port parse.
  • Query options follow the grammar shared with the Node SDK (client.connection-string.ts): tls=true|false, tls_domain, tls_ca_file are applied via WithTLS/WithTLSDomain/WithTLSCAFile; reconnection_retries, reconnection_interval, reestablish_after, heartbeat_interval and nodelay are validated for compatibility and then ignored, because the Go client takes reconnect, heartbeat and nodelay behavior from its own defaults. Unknown options and malformed values (tls=maybe, reconnection_retries=three, reconnection_interval=garbage) are rejected, so a connection string is either valid everywhere or nowhere.
  • Errors reuse the SDK sentinels: ierror.InvalidConnectionString{} and ierror.InvalidNumberValue{}. No error message includes the connection string, so a rejected password or token never leaks into logs.

How was it tested?

go test ./client/ -count=1 — 11 test functions, all passing:

  • Valid shapes: default scheme with username:password, explicit iggy+tcp:// with a personal access token, bracketed IPv6, port 0 (u16 rule shared with the other SDKs).
  • Behavioral: the issue's acceptance path — NewIggyClient(WithTcp(opts...)) connects and logs in against a fake single-node VSR server, asserting the register frame arrives before the auth-gated roster read. The same flow runs over TLS with tls=true&tls_domain=localhost&tls_ca_file=... against a TLS-only fake server, proving the option survives into the client config.
  • Rejections: the 27 malformed strings the Node SDK's table rejects, plus iggy+quic://, iggy+ws:// and non-iggy schemes; also fractional/multi-unit durations (0.5s, 1.005s, 1h 30m, 1h30m, 5sec) are accepted while 5 and garbage are not, and reconnection_retries accepts unlimited and u32 values but rejects 4294967296.
  • Secrets: no error message contains the password or token from a rejected string.
  • Negative control: with connection_string.go removed, the test file fails to compile (undefined: ParseConnectionString), confirming the feature is new.
  • Full suite: go test ./... -count=1 -race green across the module (client, tcp, errors, codec, command, hash, util, tests); go vet ./... clean; gofmt clean; go mod tidy produces no diff. The only failure in a plain go test ./... on this Windows checkout is internal/vsr TestProtocolParity_*, which fails identically on pristine master here because the CRLF checkout breaks the Rust-source regexes — unrelated to this change, and CI (Linux) is unaffected.

Documentation

The package-level doc comment on ParseConnectionString documents the accepted shapes and the cross-SDK grammar, including which options are ignored and why.

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Oct 12, 2026
@hubcio

hubcio commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

/skill team-review-slim

@choksi2212

Copy link
Copy Markdown
Author

Hi maintainers — this is my first PR to this repo, so the Pre-merge and PR Title workflows are waiting on maintainer approval (action_required) before they can run. Happy to wait, no rush; flagging in case it slipped through the queue. Title follows the conventional-commit format the PR Title workflow validates (feat(go): ...).

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.91667% with 175 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.73%. Comparing base (6ce2f92) to head (c4604c6).

Files with missing lines Patch % Lines
foreign/go/internal/fakevsr/fakevsr.go 0.00% 137 Missing ⚠️
foreign/go/client/connection_string.go 83.41% 21 Missing and 11 partials ⚠️
foreign/go/client/tcp/tcp_core.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4497      +/-   ##
============================================
- Coverage     90.77%   90.73%   -0.05%     
  Complexity     2989     2989              
============================================
  Files          1459     1461       +2     
  Lines        348165   348501     +336     
  Branches     292747   292747              
============================================
+ Hits         316042   316196     +154     
- Misses        25485    25654     +169     
- Partials       6638     6651      +13     
Components Coverage Δ
Rust Core 92.08% <ø> (-0.01%) ⬇️
Java SDK 77.80% <ø> (ø)
C# SDK 83.74% <ø> (ø)
Python SDK 85.69% <ø> (ø)
PHP SDK 90.67% <ø> (ø)
Node SDK 96.44% <ø> (ø)
Go SDK 69.31% <47.91%> (-0.66%) ⬇️
C++ SDK 85.51% <ø> (ø)
Files with missing lines Coverage Δ
foreign/go/client/tcp/tcp_core.go 85.25% <0.00%> (-1.68%) ⬇️
foreign/go/client/connection_string.go 83.41% <83.41%> (ø)
foreign/go/internal/fakevsr/fakevsr.go 0.00% <0.00%> (ø)

... and 23 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions 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.

Summary: The new Go parser for iggy:​// connection strings diverges from the shared grammar in its duration rules, drops the nodelay value although tcp.WithNoDelay exists, and can echo a credential from the unsupported-transport error. The remaining findings are small test and comment fixes.

Counts: critical 0, warning 4, nit 3, simplification 2


This review was generated by Claude Code 2.1.284 on deepseek-flash[1m]. Review the output before you act on it.

Comment thread foreign/go/client/connection_string.go
Comment thread foreign/go/client/connection_string.go
Comment thread foreign/go/client/connection_string.go Outdated
Comment thread foreign/go/client/connection_string.go
Comment thread foreign/go/client/connection_string.go Outdated
Comment thread foreign/go/client/connection_string_test.go Outdated
Comment thread foreign/go/client/connection_string_test.go Outdated
Comment thread foreign/go/client/connection_string_test.go Outdated
Comment thread foreign/go/client/connection_string_test.go Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Oct 12, 2026
choksi2212 pushed a commit to choksi2212/iggy that referenced this pull request Oct 12, 2026
Apply all nine review comments on apache#4497:

- nodelay: the parser validated the spelling and dropped it, so
  ?nodelay=false still left Nagle disabled. The parsed value now reaches
  tcp.WithNoDelay, and the client default (Nagle off) is preserved when
  the option is absent. GetNoDelay exposes the setting, so a test can
  observe the option before a connection exists.
- durations: reconnection_interval and heartbeat_interval are non-zero
  durations in the Rust SDK, so the zero spellings and zero-valued
  durations are now rejected for those two, while reestablish_after keeps
  accepting them, because Rust types it as a plain duration.
- units: the duration table now matches the Node and C# SDKs, carrying
  hr, hrs, wk, wks and month and taking millis instead of milliseconds.
- transport errors echo only an ASCII-letter transport name, so a
  malformed scheme with embedded credentials cannot leak them.
- a bad port reports InvalidConnectionString like every other parse
  failure, so errors.Is covers the whole parse.
- the IPv6 test is renamed for the bracketed host it passes.
- the rejection table is attributed to the Node SDK, whose shapes it
  mirrors, not Rust.
- the unused frameOffsetClient constant is deleted.
- the frame offsets, fake server, reply builders and self-signed
  certificate helper move into one shared internal test-support package,
  internal/fakevsr, which both test binaries import; tcp_testing_test.go
  keeps only its TCP-specific fixtures.

New tests pin each behavior change: nodelay landing on the client, the
zero-spelling rejections per option, the extended duration units, and
transport errors never echoing credentials.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
@choksi2212

Copy link
Copy Markdown
Author

Thanks for the detailed review — all nine comments are addressed in 57ce6bb, with a reply on each thread and a test pinning every behavior change:

  • nodelay now lands via tcp.WithNoDelay, with the client default (Nagle off) preserved when the option is absent. Observable through the new GetNoDelay() accessor.
  • Zero spellings are rejected for reconnection_interval and heartbeat_interval (non-zero durations in the Rust SDK) and accepted for reestablish_after (plain duration), exactly as the Rust typing splits them.
  • Duration units now match the Node and C# SDKs' table (IggyDurationParser.cs): hr, hrs, wk, wks, month, months added, millis in, milliseconds out, with exact-fraction math so 1.005s parses and 0.5ns is refused.
  • Transport errors echo only an ASCII-letter transport name, so a malformed scheme with embedded credentials cannot leak them.
  • Bad port returns InvalidConnectionString, so errors.Is covers the whole parse.
  • Test renamed to ParsesBracketedIPv6Host; the rejection table is attributed to the Node SDK; the unused frameOffsetClient is deleted.
  • The frame offsets, fake server, reply builders and self-signed-certificate helper moved into one shared internal test-support package, foreign/go/internal/fakevsr, imported by both test binaries.

Verified locally: go test ./client/... -race green (client 3.4s, tcp 24s), go vet ./... clean, gofmt clean, go mod tidy a no-op.

One ask: the earlier BDD job failure on this PR was an infra flake, not the diff — the docker build got an HTTP 500 fetching cargo-about-0.9.0 from GitHub releases (the URL returns 200 now, another PR's Pre-merge failed the same minute, and two more went green minutes later). I can't re-run workflows from a fork — could you re-run the BDD job on the new head? Everything else (Pre-merge, PR Title) is waiting on the same first-time-fork approval gate.

@choksi2212

Copy link
Copy Markdown
Author

The Go • lint run on 57ce6bb flagged a real formatting miss on my side: gofmt -l foreign/go is part of the lint task, and the import blocks in the files touched by 04be090/57ce6bb were not in gofmt order (most visibly the dot-import of internal/fakevsr sorted first instead of in place, and crypto/tls misplaced in the new parser test). My Windows checkout uses CRLF, which makes every file look unformatted to gofmt -l, so the real findings hid in the noise.

d38cad2 applies exactly gofmt -w to the committed content of the fourteen touched files - import ordering only, no logic changes:

  • gofmt -l on the committed blobs: empty for all fourteen files (verified per-blob before pushing)
  • go build ./... and go vet ./...: clean
  • go test -race -count=1 ./client/...: green (client + tcp packages, fresh test cache)

@hubcio

hubcio commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

if you PR is ready for re-review use /ready somewhere in top level comment at the beginning of line. read #4497 (comment)

@hubcio

hubcio commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

also please tone down the ai-generated replies and keep responses short and in your own words. this is starting to feel like i'm talking to an agent through you, and i'd like to hear your own reasoning about the changes. (if any)

dont getg me wrong, AI tools are welcome here. our AI assistance policy still requires you to understand the code and take responsibility for what you submit.

Comment thread foreign/go/client/connection_string.go Outdated
Comment thread foreign/go/client/connection_string.go Outdated
Comment thread foreign/go/client/connection_string.go
Comment thread foreign/go/client/connection_string_test.go Outdated
Comment thread foreign/go/client/connection_string.go Outdated
@choksi2212

Copy link
Copy Markdown
Author

Fair enough. I lean on AI tooling while working through these, but the calls here are mine and I own every line of what I submit — keeping the replies short and in my own words from here.

@choksi2212

Copy link
Copy Markdown
Author

/ready

All five points are in a1f46e4, each with a test: nodelay stays on when the query leaves it out, reconnection_interval and heartbeat_interval refuse anything under a microsecond like NonZeroIggyDuration, 1 s and µs parse the way humantime parses them, the nanosecond carry is gone, and the self-signed certificate helper lives in internal/fakevsr now. go test ./client/... -race is green, gofmt clean.

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Oct 13, 2026
@hubcio

hubcio commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@choksi2212 please rebase this PR, a huge multi-leader related PR was merged and now there are conflicts.

@hubcio hubcio added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Oct 14, 2026
Add ParseConnectionString to the Go SDK, so a caller can configure the
TCP client from a connection string the way the Rust, Node and C# SDKs
already do:

    opts, err := client.ParseConnectionString(iggy://iggy:iggy@localhost:8090)
    cli, err := client.NewIggyClient(client.WithTcp(opts...))

The parser accepts iggy:// and iggy+tcp:// with username:password or a
personal access token before the @, bracketed IPv6 hosts, and the
shared query-option grammar: tls, tls_domain and tls_ca_file are
applied through the existing WithTLS options, while the reconnect,
heartbeat and nodelay spellings are validated for cross-SDK
compatibility and then ignored, because the Go client takes those
from its own defaults. Other schemes, such as iggy+quic://, are
rejected.

Tests cover the valid shapes, both credential types, TLS (including a
full connect-and-login over TLS against a fake server), the malformed
strings each other SDK rejects, and that no error message leaks the
password or token.

Closes apache#4491

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
Apply all nine review comments on apache#4497:

- nodelay: the parser validated the spelling and dropped it, so
  ?nodelay=false still left Nagle disabled. The parsed value now reaches
  tcp.WithNoDelay, and the client default (Nagle off) is preserved when
  the option is absent. GetNoDelay exposes the setting, so a test can
  observe the option before a connection exists.
- durations: reconnection_interval and heartbeat_interval are non-zero
  durations in the Rust SDK, so the zero spellings and zero-valued
  durations are now rejected for those two, while reestablish_after keeps
  accepting them, because Rust types it as a plain duration.
- units: the duration table now matches the Node and C# SDKs, carrying
  hr, hrs, wk, wks and month and taking millis instead of milliseconds.
- transport errors echo only an ASCII-letter transport name, so a
  malformed scheme with embedded credentials cannot leak them.
- a bad port reports InvalidConnectionString like every other parse
  failure, so errors.Is covers the whole parse.
- the IPv6 test is renamed for the bracketed host it passes.
- the rejection table is attributed to the Node SDK, whose shapes it
  mirrors, not Rust.
- the unused frameOffsetClient constant is deleted.
- the frame offsets, fake server, reply builders and self-signed
  certificate helper move into one shared internal test-support package,
  internal/fakevsr, which both test binaries import; tcp_testing_test.go
  keeps only its TCP-specific fixtures.

New tests pin each behavior change: nodelay landing on the client, the
zero-spelling rejections per option, the extended duration units, and
transport errors never echoing credentials.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
CI's Format Check on the LF checkout flagged every file my two
commits touched: the import blocks were not in gofmt order (the
dot-import of internal/fakevsr sat first instead of sorted in, and
crypto/tls sorted after crypto/x509 in the new parser test).

This applies exactly 'gofmt -w' to the committed content of the
fourteen files touched by 04be090 and 57ce6bb - import ordering
only, no logic or line-ending changes in the blobs.

Verified: gofmt -l foreign/go is empty on every staged blob;
go build ./... and go vet ./... clean; go test -race -count=1
./client/... green (client 3.8s, tcp 29.3s). The internal/vsr
protocol-parity tests are untouched by this change and fail
identically on pristine 57ce6bb on a CRLF Windows checkout (their
Rust-source regexes anchor on comma-EOL), so they are a checkout
artifact here, not a regression.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
- keep TCP_NODELAY on when a query leaves nodelay out, matching the Go
  client default the other SDKs share
- refuse reconnection_interval and heartbeat_interval below one
  microsecond, the resolution the Rust wire format carries
- accept a space between an amount and its unit and the microsecond
  spelling, as humantime and the other SDK parsers do
- drop a nanosecond carry the total already folded away
- share the self-signed test certificate through internal/fakevsr

Signed-off-by: Manas Choksi <choksi2212@users.noreply.github.com>
The transport tests moved to their multi-leader request helpers upstream,
so the rebase keeps every transport test on those helpers and drops the
sweep that pointed them at fakevsr. What stays shared, as the review
asked, is the certificate helper: fakevsr.SelfSignedCert now backs
selfSignedCert, and the fake roster reply gains the ReplicaID the
multi-leader client expects.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
@choksi2212
choksi2212 force-pushed the feat/go-connection-string-4491 branch from a1f46e4 to c44ae1c Compare October 14, 2026 17:10
@choksi2212

Copy link
Copy Markdown
Author

Rebased onto master @ e9e5e10 and force-updated — thanks for the heads-up, the multi-leader rework touched exactly the helper territory this PR had refactored.

How the conflicts resolved:

  • Every transport test stays on its (new) multi-leader helpers. The earlier sweep that pointed the tcp test files at fakevsr is gone — tcp_testing_test.go and friends are byte-identical to master again, so the multi-leader assertions (new client per failover, reset request counters, roster reads) are untouched.
  • The shared-certificate ask from your review survives: fakevsr.SelfSignedCert is now the single implementation, and the transport suite reaches it through the local selfSignedCert wrapper in tcp_connect_test.go.
  • fakevsr shrank to what the connection-string suite needs (fake server + reply builders + the cert helper), and its roster reply gained the ReplicaID the multi-leader client expects — everything else was pruned rather than left half-dead.

Verification on the new head:

  • go build ./... clean, go vet ./client/... ./internal/fakevsr/... clean, gofmt clean on all five changed files.
  • go test ./client/... -race -count=1: both client and client/tcp pass — all 14 TestParseConnectionString_* cases against the multi-leader client (connect-and-login against the fake server still observes register → cluster-metadata, so the login sequence the issue cares about is unchanged), plus the full transport suite.
  • The internal/vsr protocol-parity tests fail in my local checkout, but identically on pristine master (they parse the Rust sources and my Windows checkout's line endings break the regexes) — untouched by this diff either way.

The five review points are all still in: nodelay defaults to on, sub-microsecond intervals rejected with boundary tests, spaces/µs accepted like the node SDK, the carry-block simplification, and the shared cert helper.

@choksi2212

Copy link
Copy Markdown
Author

Thanks again for the multi-leader heads-up — the branch is rebased and updateRef-pushed (head c44ae1c), but the fork pull_request workflows haven't run on any head of this PR yet: first-time-fork CI needs a maintainer approval to start. Everything is verified locally on the rebased head: go build ./..., go vet ./... and gofmt -l are clean, and go test ./client/... -race is green across both packages, including all 14 connection-string tests against the new multi-leader client (the vsr parity failures noted in my earlier comment are pre-existing on a pristine master worktree). Happy to re-run anything once CI can speak.

@choksi2212

Copy link
Copy Markdown
Author

@hubcio gently pinging this one for a re-review when you have a moment. All five points from your review are addressed in a1f46e4 (per-point summary in my /ready comment from Oct 13), and the rebased head 8ada46b has the full CI green (51 checks, including the Go build/test/e2e/lint suite). Happy to adjust anything else that does not look right.

…n-string-4491

Resolved the single conflict (foreign/go/client/tcp/tcp_core.go) by
taking upstream's restructured core and re-grafting GetNoDelay() after
GetConnectionInfo, so the parsed nodelay option stays observable before
the first connection. Verified on the merge result: full foreign/go
test suite green (client, client/tcp incl. the connection-string tests,
internal/vsr protocol parity), go vet clean, gofmt clean.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
@choksi2212

Copy link
Copy Markdown
Author

Rebased onto current master (was 24 commits behind, including the two breaking foreign/go changes in #4550 and #4561), so the branch stays mergeable while awaiting the re-review.

The single conflict was in tcp_core.go: master restructured that region for partition routing, so I took master's side wholesale and re-grafted GetNoDelay() after GetConnectionInfo, keeping the parsed nodelay option observable before the first connection. Everything else merged clean, including the connection-string parser and its tests.

Verified on the merge result (480d4fd7):

  • go test ./client/... ./internal/vsr/... — all green, including the 11 connection-string tests and the VSR protocol-parity suite against the new Rust enums
  • go vet ./... — clean
  • gofmt — clean
  • git diff master...feat/go-connection-string-4491 is exactly the five files of this PR again, so the merge drops none of master's partition-routing work

The five review points from the /ready summary are unchanged by the rebase.

@hubcio

hubcio commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

@choksi2212 when PR is ready for re-review put /ready at the beginning of any top level comment, like so:
/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Oct 20, 2026
@choksi2212

Copy link
Copy Markdown
Author

/ready

Rebased onto current master and verified locally on the merge result: go build/vet clean, gofmt clean, go test ./client/... -race green.

Comment thread foreign/go/client/connection_string.go
Comment thread foreign/go/internal/fakevsr/fakevsr.go
Comment thread foreign/go/client/tcp/tcp_core.go Outdated
Comment thread foreign/go/internal/fakevsr/fakevsr.go Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Oct 20, 2026
The parser validated heartbeat_interval but dropped it, so the client
kept its five-second default no matter what the connection string
asked for. The interval now reaches tcp.WithHeartbeatInterval after a
checked int64 conversion, and a value wider than time.Duration fails
the parse instead of wrapping. The tcp test helpers readRequest and
clusterMetadataFrame now delegate to the shared fakevsr builders.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
@choksi2212

Copy link
Copy Markdown
Author

/ready

heartbeat_interval now reaches tcp.WithHeartbeatInterval after a checked int64 conversion; a value wider than time.Duration fails the parse instead of wrapping. Pinned with a new test through a GetHeartbeatInterval accessor: default 5s without the option, 1s and 250ms applied, 1000y rejected.

readRequest and clusterMetadataFrame in the tcp tests now delegate to the fakevsr builders, with a small adapter where the local request type differs. The full tcp suite passes with -race through the wrappers.

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Oct 20, 2026
Resolve the connect-test imports against the apache#4571/apache#4625 upstream wave:
keep the fakevsr delegation for the self-signed cert and add fmt/strings
for the new silent sign-in tests. tcp_core.go and tcp_testing_test.go
auto-merged.

Verified on the merge result: go build ./... clean, go vet clean on
client + fakevsr, client suite ok, full tcp suite green on rerun
(the one first-run failure, TestDriverAfterSilentMetadataReplica-
DiscoversThroughAnotherLink at 0.01s, also flakes on pristine
upstream/master where a different tcp test failed its own full run).

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
@choksi2212

Copy link
Copy Markdown
Author

Merged current master (through 6ce2f92a, the #4571 refactor wave) into this branch so the review isn't against a stale base. The only textual conflict was the import block in tcp_connect_test.go: the cert-minting helper delegation to fakevsr is kept, and fmt/strings are added for the new silent sign-in tests. tcp_core.go and tcp_testing_test.go auto-merged cleanly against the new markBound/hasRoster internals.

Verified on the merge result:

  • go build ./... clean, go vet clean on client + internal/fakevsr
  • connection-string suite green in every run (TestParseConnectionString_*, all 14)
  • full client package green; full client/tcp suite green on a clean run

One honest caveat about the tcp suite on my local box: across five full-package runs it intermittently failed three different tests (TestDriverAfterSilentMetadataReplicaDiscoversThroughAnotherLink, TestPrimaryPoll_InvalidBindingDoesNotPollAndRetiresConnection, and on pristine master TestSessionRecovery_StopsOnDisconnectOrClose). Each passes deterministically when re-run, and pristine master flakes there too, so it is contention on my machine rather than anything this branch introduces - the TestDriverAfterSilent... failure I saw on the first run reproduced at 0.01s and never again.

…GetNoDelay lock

Both fake-server helpers carried a done channel nothing ever read: the
field, its allocation and its deferred close are gone from fakevsr.Server
and from the tcp suite's fakeServer. GetNoDelay now reads the
construction-frozen config directly, like the dial path does;
GetHeartbeatInterval keeps its lock because a test rewrites
config.heartbeatInterval after construction.

Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go SDK: parse iggy:// connection strings (TCP only)

6 participants