fix: extend NodeDiagnostics with node state, distance, datacenter and pool size (DRIVER-540)#887
Merged
dkropachev merged 1 commit intoMay 14, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends DriverTimeoutException.NodeDiagnostics to include additional node topology/health context at the time a driver timeout occurs, making timeout messages more actionable for debugging.
Changes:
- Added
nodeState,nodeDistance,datacenter, andpoolSizetoDriverTimeoutException.NodeDiagnostics, including getters and updatedtoString(). - Updated CQL/Graph/Continuous request handlers to populate the new diagnostics fields from
NodeandChannelPool.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java | Passes node state/distance/DC and pool size into NodeDiagnostics.of() at timeout time. |
| core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlPrepareHandler.java | Same as above for prepare timeouts. |
| core/src/main/java/com/datastax/oss/driver/api/core/DriverTimeoutException.java | Extends NodeDiagnostics API and updates string rendering/message formatting. |
| core/src/main/java/com/datastax/dse/driver/internal/core/graph/GraphRequestHandler.java | Same as above for graph timeouts. |
| core/src/main/java/com/datastax/dse/driver/internal/core/cql/continuous/ContinuousRequestHandlerBase.java | Same as above for continuous paging/global timeouts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dkropachev
approved these changes
May 13, 2026
| return baseMessage; | ||
| } | ||
| return baseMessage + " — node in flight: " + nodeDiagnostics; | ||
| return baseMessage + " \u2014 node in flight: " + nodeDiagnostics; |
… pool size (DRIVER-540) Add four additional fields to DriverTimeoutException.NodeDiagnostics captured at timeout time: - nodeState: UP/DOWN/FORCED_DOWN/UNKNOWN — immediately explains timeouts to downed nodes - nodeDistance: LOCAL/REMOTE/IGNORED — contextualizes latency expectations - datacenter: node DC — helps diagnose cross-DC routing issues - poolSize: active connection count — reveals degraded pools (fewer connections than expected) All four are available from Node and ChannelPool already in scope at each buildNodeDiagnostics() call site. No new infrastructure required. Updated toString() example: /10.0.0.1:9042 [state: UP, distance: LOCAL, dc: dc1, channel in-flight: 5, pool size: 3, pool in-flight: 12, pool available ids: 988, pool orphaned ids: 2]
62bf3c1 to
40b83bf
Compare
dkropachev
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows up on #883.
Fixes: DRIVER-540
Problem
The
NodeDiagnosticssnapshot introduced in #883 captures stream-ID and in-flight counts at timeout time, but gives no context about the node's health or topology. Two important diagnostic questions remain unanswered:Changes
Four additional fields added to
DriverTimeoutException.NodeDiagnostics:nodeStateNode.getState()nodeDistanceNode.getDistance()datacenterNode.getDatacenter()poolSizeChannelPool.size()All four are available from the
NodeandChannelPoolobjects already in scope at eachbuildNodeDiagnostics()call site. No new infrastructure required.Updated message format
Files changed
DriverTimeoutException.java— new fields, getters, Javadoc, updatedtoString()CqlRequestHandler.java,CqlPrepareHandler.java,GraphRequestHandler.java,ContinuousRequestHandlerBase.java— pass new fields toNodeDiagnostics.of()Notes