Skip to content

update dependencies and enhance connection handling in metrics#433

Merged
OutOfBedlam merged 1 commit into
mainfrom
work-tune
Jun 30, 2026
Merged

update dependencies and enhance connection handling in metrics#433
OutOfBedlam merged 1 commit into
mainfrom
work-tune

Conversation

@OutOfBedlam

Copy link
Copy Markdown
Contributor

This pull request introduces several improvements and fixes across the connection pooling, metrics collection, and SQL driver testing subsystems. The most significant changes include making the metrics collector non-blocking under load, improving connection pool error handling and configuration, and expanding test coverage for SQL wrappers and connection pooling.

Metrics Collection Improvements:

  • The Collector in metric.go now uses a much larger buffer (recvChSize increased from 100 to 10,000) and is non-blocking: if the buffer is full, new measurements are dropped and a counter is incremented to track how many were dropped. This prevents request goroutines from blocking due to backpressure. A new method, DroppedCount(), exposes the number of dropped measurements. Unit tests verify this behavior. [1] [2] [3] [4] [5]

Connection Pooling and Error Handling:

  • The default database pool is now configured with sensible limits for open/idle connections and connection lifetimes, and is proactively pinged to catch errors early.
  • The HTTP query handler now strictly requires a working connection pool; if unavailable, it returns HTTP 503 (Service Unavailable) with a Retry-After header, rather than falling back to a direct connection.
  • System metrics no longer report pool availability as a binary metric, but continue to collect pool stats if available.
  • The dashboard exposes new charts for connection pool stats, including open/in-use/idle connections, wait durations, and closed connections.

Testing and SQL Wrapper Enhancements:

  • Test stubs for pooled connections are improved for more realistic behavior, and tests are updated to check for proper error handling and connection counting. [1] [2] [3] [4]
  • Additional tests cover edge cases and error branches in SQL row and connection wrappers, including type mapping and error propagation. [1] [2] [3] [4] [5]

Dependency Update:

  • The github.com/machbase/neo-client dependency is updated to a newer version.

These changes collectively improve system robustness under load, provide better observability for connection pooling, and increase test reliability and coverage.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.51163% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.46%. Comparing base (2a57ab6) to head (350e6e5).

Files with missing lines Patch % Lines
mods/server/http_query.go 17.64% 12 Missing and 2 partials ⚠️
mods/util/metric/metric.go 66.66% 3 Missing and 3 partials ⚠️
spi/metrics.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #433      +/-   ##
==========================================
+ Coverage   65.40%   65.46%   +0.05%     
==========================================
  Files         351      351              
  Lines       69696    69720      +24     
==========================================
+ Hits        45585    45640      +55     
+ Misses      19264    19229      -35     
- Partials     4847     4851       +4     

☔ 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.

@OutOfBedlam OutOfBedlam merged commit 2a62703 into main Jun 30, 2026
8 of 9 checks passed
@OutOfBedlam OutOfBedlam deleted the work-tune branch June 30, 2026 06:04
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.

1 participant