Skip to content

Standardized gremlin-go connection options#3467

Open
GumpacG wants to merge 4 commits into
apache:masterfrom
GumpacG:connection-options-go
Open

Standardized gremlin-go connection options#3467
GumpacG wants to merge 4 commits into
apache:masterfrom
GumpacG:connection-options-go

Conversation

@GumpacG

@GumpacG GumpacG commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Standardize gremlin-go connection options

Implements the Go portion of the TinkerPop 4.x GLV connection-options standardization. Renames several settings fields to canonical names, moves the authentication helpers into a dedicated auth sub-package (flat functions kept as deprecated delegators), aligns defaults, adds new options, and fixes a silent proxy drop. Go driver changes only; the other GLVs follow in separate PRs.

Proposal: https://lists.apache.org/thread/yqtr2wnb1kq2pqqq4002cz511q5o0bkg

Renames (breaking)

Struct fields cannot be aliased, so these are hard renames and existing code must be updated.

Old New Default
MaximumConcurrentConnections MaxConnections 128
IdleConnectionTimeout IdleTimeout 180s
KeepAliveInterval KeepAliveTime 30s
ConnectionTimeout ConnectTimeout 5s
TlsConfig (*tls.Config) Ssl -
RequestInterceptors Interceptors -
EnableCompression Compression -

Auth helpers moved out of package gremlingo into a new auth sub-package (github.com/apache/tinkerpop/gremlin-go/v4/driver/auth):

Old New
BasicAuth auth.Basic
SigV4Auth auth.SigV4
SigV4AuthWithCredentials auth.SigV4WithCredentials

The flat gremlingo auth functions are retained as deprecated delegators (idiomatic Go // Deprecated: doc comments) so existing code keeps compiling. New code should use the auth sub-package.

Behavior changes (breaking)

  • Compression is now a typed Compression const (gremlingo.CompressionNone/gremlingo.CompressionDeflate) and defaults to CompressionDeflate (on); the driver sends Accept-Encoding: deflate by default. Set gremlingo.CompressionNone to disable. The manual per-chunk deflate decode path is retained.
  • http.Transport.Proxy now defaults to http.ProxyFromEnvironment, so HTTP_PROXY/HTTPS_PROXY/NO_PROXY are honored. The custom transport previously left Proxy unset, silently dropping any environment proxy configuration.

New options

  • ReadTimeout (default 0, off) - a per-read idle timeout reset on each read of the response body and re-armed across pooled-connection reuse, so it never fires while a pooled connection is idle between requests.
  • MaxResponseHeaderBytes - exposes http.Transport.MaxResponseHeaderBytes (native bytes).
  • Proxy - an explicit proxy override for the transport.
  • DefaultBatchSize (64) - connection-level default that fills a request's batchSize when unset.

The Go-specific MaxIdleConnections (count-based idle keep-alive cap, default 8) is unchanged.

Removed (breaking)

  • MaxResponseContentLength - responses now stream; ReadTimeout is the partial mitigation.

Testing

  • gremlin-go go build ./... and go vet ./... pass.
  • Unit tests pass, including the relocated auth tests: auth.TestBasic/auth.TestSigV4 in the new auth sub-package, and TestDeprecatedBasicAuth/TestDeprecatedSigV4Auth covering the deprecated delegators.
  • CHANGELOG, reference config table (gremlin-variants.asciidoc), and upgrade guide (release-4.x.x.asciidoc) updated for the Go slice.

Assisted-by: Kiro: Claude Opus 4.8

Assisted-by: Kiro: Claude Opus 4.8
@codecov-commenter

codecov-commenter commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.10%. Comparing base (a28cd1f) to head (b48aa07).
⚠️ Report is 150 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3467      +/-   ##
============================================
- Coverage     76.35%   76.10%   -0.26%     
- Complexity    13424    13646     +222     
============================================
  Files          1012     1026      +14     
  Lines         60341    61743    +1402     
  Branches       7075     7209     +134     
============================================
+ Hits          46076    46989     +913     
- Misses        11548    11869     +321     
- Partials       2717     2885     +168     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Assisted-by: Kiro: Claude Opus 4.8
@kenhuuu

kenhuuu commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This PR has some open questions that are the same as the ones I mentioned in the PRs for the other GLVs. Other than those this LGTM.

defaultBatchSize to batchSize
Docs update
Timeout and timeout millis
Removed deprecated options

Assisted-by: Kiro: Claude Opus 4.8
@GumpacG GumpacG force-pushed the connection-options-go branch from 5ca4252 to 6d5d559 Compare June 24, 2026 22:30
@kenhuuu

kenhuuu commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

VOTE +1

@Cole-Greer Cole-Greer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

VOTE +1

@xiazcy

xiazcy commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

VOTE +1

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.

5 participants