GH-863: [Flight SQL][JDBC] Suppress benign CloseSession errors when catalog is set #864
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.
fixes #863
Rationale for this change
When using the Flight SQL JDBC driver with connection pooling and a catalog parameter,
ArrowFlightSqlClientHandler.close()
performs aCloseSession
RPC that can fail during gRPC channel shutdown. These transient failures (UNAVAILABLE
orINTERNAL
with "Connection closed after GOAWAY") bubble up asSQLException
and cause noisy errors in pooling frameworks like Apache Commons DBCP.What changes are included in this PR?
Core Changes
ArrowFlightSqlClientHandler.close()
for both:CloseSession
RPC callsAutoCloseable
resource cleanupisBenignCloseException()
,logSuppressedCloseException()
,handleBenignCloseException()
Error Suppression Logic
Suppress only these specific transient shutdown conditions:
FlightStatusCode.UNAVAILABLE
FlightStatusCode.INTERNAL
with message containing "Connection closed after GOAWAY"Logging Improvements
Are there any user-facing changes?
Yes - Improved user experience:
SQLException
)How was this patch tested?
Integration Testing
data.dremio.cloud:443
)jdbc:arrow-flight-sql://data.dremio.cloud:443/?token=<PAT>&catalog=<PROJECT_ID>
Validation Steps
UNAVAILABLE
/INTERNAL("Connection closed after GOAWAY")
errors during connection closeSQLException