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

    https://github.com/apache/tajo/pull/621#discussion_r34963696
  
    --- Diff: 
tajo-client/src/main/java/org/apache/tajo/client/SessionConnection.java ---
    @@ -98,33 +106,49 @@ public SessionConnection(@NotNull ServiceTracker 
tracker, @Nullable String baseD
         
this.manager.setRetries(properties.getInt(RpcConstants.RPC_CLIENT_RETRY_MAX, 
RpcConstants.DEFAULT_RPC_RETRIES));
         this.userInfo = UserRoleInfo.getCurrentUser();
     
    -    try {
    -      this.client = getTajoMasterConnection();
    -    } catch (ServiceException e) {
    -      throw new IOException(e);
    -    }
    +    this.client = getTajoMasterConnection();
       }
     
       public Map<String, String> getClientSideSessionVars() {
         return Collections.unmodifiableMap(sessionVarsCache);
       }
     
    -  public synchronized NettyClientBase getTajoMasterConnection() throws 
ServiceException {
    -    if (client != null && client.isConnected()) return client;
    -    else {
    +  public synchronized NettyClientBase getTajoMasterConnection() throws 
SQLException {
    +
    +    if (client != null && client.isConnected()) {
    +      return client;
    +    } else {
    +
           try {
             RpcClientManager.cleanup(client);
    +
             // Client do not closed on idle state for support high available
    -        this.client = manager.newClient(getTajoMasterAddr(), 
TajoMasterClientProtocol.class, false,
    -            manager.getRetries(), 0, TimeUnit.SECONDS, false);
    +        this.client = manager.newClient(
    +            getTajoMasterAddr(),
    +            TajoMasterClientProtocol.class,
    +            false,
    +            manager.getRetries(),
    +            0,
    +            TimeUnit.SECONDS,
    +            false);
             connections.incrementAndGet();
    -      } catch (Exception e) {
    -        throw new ServiceException(e);
    +
    +      } catch (Throwable t) {
    +        throw SQLExceptionUtil.makeUnableToEstablishConnection(t);
           }
    +
           return client;
         }
       }
     
    +  protected BlockingInterface getTMStub() throws SQLException {
    --- End diff --
    
    I won't use TM for Tajo Metadata Connection. We can use TM only for 
TajoMaster. How do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to