phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <>
Subject [jira] [Created] (PHOENIX-3564) Initialize transaction manager client after opening HConnection
Date Thu, 05 Jan 2017 00:12:58 GMT
James Taylor created PHOENIX-3564:

             Summary: Initialize transaction manager client after opening HConnection
                 Key: PHOENIX-3564
             Project: Phoenix
          Issue Type: Bug
            Reporter: James Taylor
            Assignee: Thomas D'Silva

We should call after the HConnection has successfully been opened here in ConnectionQueryServicesImpl:
    private void openConnection() throws SQLException {
        try {
            boolean transactionsEnabled = props.getBoolean(
            // only initialize the tx service client if needed
            if (transactionsEnabled) {
            this.connection = HBaseFactoryProvider.getHConnectionFactory().createConnection(this.config);
        } catch (IOException e) {
            throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_ESTABLISH_CONNECTION)
        if (this.connection.isClosed()) { // TODO: why the heck doesn't this throw above?
            throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_ESTABLISH_CONNECTION).build().buildException();

This will prevent multiple instantiations of TephraZKClientService and prevent many Zookeeper
connections from being opened if an HConnection cannot be established.

We should also call TephraZKClientService.stop() in ConnectionQueryServicesImpl.close(). Although
this doesn't appear to close the Zookeeper connection, it probably should (see TEPHRA-207).

This message was sent by Atlassian JIRA

View raw message