Skip to content

Getting NoSuchElementException intermittently #130

@ranjp2

Description

@ranjp2

Driver version

2.1.0.30

Redshift version

PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.80583

Client Operating System

macOS

JAVA/JVM version

17..0.2

Table schema

public (default)

Problem description

While trying to query Redshift in the above mentioned environment, we intermittently encounter NoSuchElementException, being throw from the redshift driver. We establish the connection using Hikari connection pool.

  1. Expected behaviour: We expect the query to be executed against the records stored in redshift successfully everytime.
  2. Actual behaviour: The query is not executed successfully everytime and we get NoSuchElementException intermittently.
  3. Error message/stack trace: Caused by: java.util.NoSuchElementException
    at java.base/java.util.ArrayDeque.removeFirst(ArrayDeque.java:362)
    at com.amazon.redshift.core.v3.QueryExecutorImpl.processResultsOnThread(QueryExecutorImpl.java:2391)
    at com.amazon.redshift.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
    at com.amazon.redshift.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1878)
    at com.amazon.redshift.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:375)
    at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeInternal(RedshiftStatementImpl.java:519)
    at com.amazon.redshift.jdbc.RedshiftStatementImpl.execute(RedshiftStatementImpl.java:440)
    at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeWithFlags(RedshiftStatementImpl.java:381)
    at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeCachedSql(RedshiftStatementImpl.java:367)
    at com.amazon.redshift.jdbc.RedshiftStatementImpl.executeWithFlags(RedshiftStatementImpl.java:344)
    at com.amazon.redshift.jdbc.RedshiftStatementImpl.execute(RedshiftStatementImpl.java:334)
    at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:98)
    at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
    at com.pega.pegarules.data.internal.access.GenericExecutor.execute(GenericExecutor.java:40)
  4. Any other details that can be helpful: We use HikariCP for establishing connection between client (macOS) and server (serverless redshift)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions