Skip to content

Commit dc63285

Browse files
committed
GH-863: Fix log level and formatting
1 parent 39f86fa commit dc63285

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,15 @@ public void close() throws SQLException {
265265
try {
266266
sqlClient.closeSession(new CloseSessionRequest(), getOptions());
267267
} catch (FlightRuntimeException fre) {
268-
handleBenignCloseException(fre, "Failed to close Flight SQL session.", "closing Flight SQL session");
268+
handleBenignCloseException(
269+
fre, "Failed to close Flight SQL session.", "closing Flight SQL session");
269270
}
270271
}
271272
try {
272273
AutoCloseables.close(sqlClient);
273274
} catch (FlightRuntimeException fre) {
274-
handleBenignCloseException(fre, "Failed to clean up client resources.", "closing Flight SQL client");
275+
handleBenignCloseException(
276+
fre, "Failed to clean up client resources.", "closing Flight SQL client");
275277
} catch (final Exception e) {
276278
throw new SQLException("Failed to clean up client resources.", e);
277279
}
@@ -286,7 +288,9 @@ public void close() throws SQLException {
286288
* @param operationDescription description of the operation for logging
287289
* @throws SQLException if the exception represents a genuine failure
288290
*/
289-
private void handleBenignCloseException(FlightRuntimeException fre, String sqlErrorMessage, String operationDescription) throws SQLException {
291+
private void handleBenignCloseException(
292+
FlightRuntimeException fre, String sqlErrorMessage, String operationDescription)
293+
throws SQLException {
290294
if (isBenignCloseException(fre)) {
291295
logSuppressedCloseException(fre, operationDescription);
292296
} else {
@@ -302,7 +306,8 @@ private void handleBenignCloseException(FlightRuntimeException fre, String sqlEr
302306
* @param operationDescription description of the operation for logging
303307
* @throws FlightRuntimeException if the exception represents a genuine failure
304308
*/
305-
private void handleBenignCloseException(FlightRuntimeException fre, String operationDescription) throws FlightRuntimeException {
309+
private void handleBenignCloseException(FlightRuntimeException fre, String operationDescription)
310+
throws FlightRuntimeException {
306311
if (isBenignCloseException(fre)) {
307312
logSuppressedCloseException(fre, operationDescription);
308313
} else {
@@ -311,8 +316,8 @@ private void handleBenignCloseException(FlightRuntimeException fre, String opera
311316
}
312317

313318
/**
314-
* Determines if a FlightRuntimeException represents a benign close operation error
315-
* that should be suppressed.
319+
* Determines if a FlightRuntimeException represents a benign close operation error that should be
320+
* suppressed.
316321
*
317322
* @param fre the FlightRuntimeException to check
318323
* @return true if the exception should be suppressed, false otherwise
@@ -330,13 +335,10 @@ private boolean isBenignCloseException(FlightRuntimeException fre) {
330335
* @param fre the FlightRuntimeException being suppressed
331336
* @param operationDescription description of the operation for logging
332337
*/
333-
private void logSuppressedCloseException(FlightRuntimeException fre, String operationDescription) {
334-
// ARROW-17785: suppress exceptions caused by flaky gRPC layer during shutdown
335-
if (LOGGER.isDebugEnabled()) {
336-
LOGGER.debug("Suppressed error {}", operationDescription, fre);
337-
} else {
338-
LOGGER.info("Suppressed benign error {}: {}", operationDescription, fre.getMessage());
339-
}
338+
private void logSuppressedCloseException(
339+
FlightRuntimeException fre, String operationDescription) {
340+
// ARROW-17785 and GH-863: suppress exceptions caused by flaky gRPC layer during shutdown
341+
LOGGER.info("Suppressed error {}", operationDescription, fre);
340342
}
341343

342344
/** A prepared statement handler. */

0 commit comments

Comments
 (0)