Background
This is a minor improvement to enhance error handling so that clients do not receive misleading errors, following up on customer report inc-zd62350-solitics (CUSTOMER-245).
Summary
Ensure the driver checks if CqlSession is closed before handling errors (e.g. NoNodeAvailableException) during shutdown, to avoid misleading error handling and noisy logs.
Problem
When an application shuts down and closes the CqlSession, in-flight requests may throw NoNodeAvailableException. The driver does not currently check whether the session is already closed before surfacing these errors, leading to misleading error logs during an otherwise clean shutdown.
Stack Trace
com.datastax.oss.driver.api.core.NoNodeAvailableException: No node was available to execute the query
at com.datastax.oss.driver.api.core.NoNodeAvailableException.copy(NoNodeAvailableException.java:42) ~[java-driver-core-4.19.0.6.jar!/:?]
17:25:24.441 [pool-39-thread-14] ERROR com.beezer.service.oapi.services.UniqueKeyValueService - Can not read from scylla DB: No node was available to execute the query
Expected Behavior
When the session is being closed or is already closed, errors like NoNodeAvailableException should either be suppressed or clearly attributed to shutdown rather than surfaced as real errors.
Driver
- Driver:
java-driver
- Branch:
4.x
Background
This is a minor improvement to enhance error handling so that clients do not receive misleading errors, following up on customer report inc-zd62350-solitics (CUSTOMER-245).
Summary
Ensure the driver checks if
CqlSessionis closed before handling errors (e.g.NoNodeAvailableException) during shutdown, to avoid misleading error handling and noisy logs.Problem
When an application shuts down and closes the
CqlSession, in-flight requests may throwNoNodeAvailableException. The driver does not currently check whether the session is already closed before surfacing these errors, leading to misleading error logs during an otherwise clean shutdown.Stack Trace
Expected Behavior
When the session is being closed or is already closed, errors like
NoNodeAvailableExceptionshould either be suppressed or clearly attributed to shutdown rather than surfaced as real errors.Driver
java-driver4.x