Skip to content

Standardized gremlin-dotnet connection options#3468

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

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

Conversation

@GumpacG

@GumpacG GumpacG commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Standardize gremlin-dotnet connection options

Implements the .NET portion of the TinkerPop 4.x GLV connection-options standardization. Renames several ConnectionSettings properties and the Auth factory methods to canonical names (old names kept as [Obsolete] deprecated aliases), aligns defaults, adds new options, and fixes two latent bugs. .NET driver changes only; the other GLVs follow in separate PRs.

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

Renames (deprecated aliases retained)

Old New Default
MaxConnectionsPerServer MaxConnections 128
IdleConnectionTimeout IdleTimeout 180s
ConnectionTimeout ConnectTimeout 5s
KeepAliveInterval KeepAliveTime 30s
EnableCompression Compression -
Auth.BasicAuth Auth.Basic -
Auth.SigV4Auth Auth.Sigv4 -

The old property names and auth methods are retained as [Obsolete] deprecated aliases (marked "As of release 4.0.0, ...") that delegate to the canonical members, so existing code keeps compiling.

Behavior changes (breaking)

  • ConnectTimeout default lowered 15s → 5s.
  • KeepAliveTime is now wired to a real TCP keep-alive socket option (via SocketsHttpHandler.ConnectCallback) rather than the inert HTTP/2 ping timeout, which had no effect on HTTP/1.1. It enables SO_KEEPALIVE and sets the per-socket idle time on Windows, Linux, and macOS; on other platforms keep-alive stays enabled at the OS default idle time.
  • Compression is now a {None, Deflate} enum defaulting to Deflate (compression on by default); the driver sends Accept-Encoding: deflate by default. Set Compression.None to disable. The deprecated EnableCompression bool is preserved only as a compatibility shim mapping true/false to Compression.Deflate/Compression.None.

New options

  • Ssl (SslClientAuthenticationOptions) - adds client-certificate and custom-CA support. SkipCertificateValidation is applied to an internal copy rather than mutating the caller's options.
  • DefaultBatchSize (64) - connection-level default that fills the per-request batchSize when unset.
  • MaxResponseHeaderBytes - the maximum response header size, in bytes (converted internally to the handler's native kilobyte unit).
  • ReadTimeout - a per-read idle timeout applied to each read of the response stream (via per-read CancelAfter).
  • Proxy (IWebProxy) - routes connections through an HTTP proxy.
  • GremlinServer.FromUrl(string) / GremlinServer(Uri) - configure the endpoint from a single URL (scheme, host, port, path), deriving SSL from the scheme. The existing host/port/path constructor remains.

Removed (breaking)

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

Bug fixes

  • Fixed deflate response decompression, which threw on the server's zlib-framed output because it used DeflateStream (raw DEFLATE, RFC 1951) instead of ZLibStream (zlib, RFC 1950). The bug was previously masked because compression was off by default; turning it on by default would have made it a default-path failure.
  • Fixed Ssl options cloning (used on the skip-certificate-validation path) to copy ClientCertificateContext and AllowTlsResume, which were previously dropped, breaking mTLS client certificates and silently re-enabling TLS resumption.

Testing

  • gremlin-dotnet unit tests pass (695 tests), including new ConnectionSettingsTests and the ReadTimeout slow-read timeout test.
  • CHANGELOG, reference config table (gremlin-variants.asciidoc), and upgrade guide (release-4.x.x.asciidoc) updated for the .NET slice.

Assisted-by: Kiro: Claude Opus 4.8

@codecov-commenter

codecov-commenter commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3468      +/-   ##
============================================
- Coverage     76.35%   75.83%   -0.53%     
- Complexity    13424    13650     +226     
============================================
  Files          1012      995      -17     
  Lines         60341    55471    -4870     
  Branches       7075     7209     +134     
============================================
- Hits          46076    42067    -4009     
+ Misses        11548    10822     -726     
+ Partials       2717     2582     -135     

☔ 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
@GumpacG GumpacG force-pushed the connection-options-dotnet branch from a18c17d to 13e2d49 Compare June 19, 2026 16:09
Comment thread gremlin-dotnet/src/Gremlin.Net/Driver/ConnectionSettings.cs Outdated
GumpacG added 2 commits June 23, 2026 21:37
Timeout milliseconds
DefaultBatchSize to BatchSize
Removed deprecated options

Assisted-by: Kiro: Claude Opus 4.8
@GumpacG GumpacG force-pushed the connection-options-dotnet branch from 02f5e62 to c7264e8 Compare June 24, 2026 04:53
@kenhuuu

kenhuuu commented Jun 25, 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.

3 participants