Github user milindt commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1094#discussion_r162286759
  
    --- 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 --
    
    We don't want clean up to run on successful connection though, we just want 
to cover all the exceptions. On a successful connection, the "Curator" threads 
will be created but the number of threads will be proportional to number of 
connections, which can be be controlled by using a connection pool, hence it 
won't cause this issue. 
    
    On the other hand,  calling cleanup on a successful connection may 
terminate that connection.  Thoughts?


---

Reply via email to