Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-25675

Intermittent PSQLException when trying to connect to Postgres in tests

    XMLWordPrintableJSON

Details

    Description

      The following exception appears intermittently when running tests using dockerized Postgres.

      Unexpected exception org.postgresql.util.PSQLException: FATAL: the database system is starting up
      21:26:55  	at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525)
      21:26:55  	at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146)
      21:26:55  	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197)
      21:26:55  	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
      21:26:55  	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217)
      21:26:55  	at org.postgresql.Driver.makeConnection(Driver.java:458)
      21:26:55  	at org.postgresql.Driver.connect(Driver.java:260)
      21:26:55  	at java.sql.DriverManager.getConnection(DriverManager.java:664)
      21:26:55  	at java.sql.DriverManager.getConnection(DriverManager.java:247)
      21:26:55  	at org.apache.hadoop.hive.ql.externalDB.AbstractExternalDB.execute(AbstractExternalDB.java:191)
      21:26:55  	at org.apache.hadoop.hive.ql.qoption.QTestDatabaseHandler.beforeTest(QTestDatabaseHandler.java:116)
      21:26:55  	at org.apache.hadoop.hive.ql.qoption.QTestOptionDispatcher.beforeTest(QTestOptionDispatcher.java:79)
      21:26:55  	at org.apache.hadoop.hive.ql.QTestUtil.cliInit(QTestUtil.java:717)
      21:26:55  	at org.apache.hadoop.hive.cli.control.CoreCliDriver.runTest(CoreCliDriver.java:189)
      21:26:55  	at org.apache.hadoop.hive.cli.control.CliAdapter.runTest(CliAdapter.java:104)
      21:26:55  	at org.apache.hadoop.hive.cli.TestMiniLlapLocalCliDriver.testCliDriver(TestMiniLlapLocalCliDriver.java:62)
      

      As the exception indicates when we try to connect to Postgres the database is not yet completely ready despite the fact that the respective port is open thus leading to the previous exception.

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m