Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/1094#discussion_r162282830
--- Diff:
exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java ---
@@ -132,10 +132,12 @@ protected DrillConnectionImpl(DriverImpl driver,
AvaticaFactory factory,
bit = new Drillbit(dConfig, serviceSet);
bit.run();
} catch (final UserException e) {
+ cleanup();
throw new SQLException(
"Failure in starting embedded Drillbit: " + e.getMessage(),
e);
} catch (Exception e) {
+ cleanup();
--- End diff --
I suppose you can use finally block to perform clean up instead of
repeating `cleanup` method call after each cached exception.
---