aws / aws/amazon-redshift-jdbc-driver
Getting NoSuchElementException intermittently
- Dominant language
- Java
- Stars
- 71
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
## 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)
Contributor guide
Research direction
Start in QueryExecutorImpl.processResultsOnThread at line 2391, using the supplied stack trace as the entry point. Reproduce repeated queries against serverless Redshift with HikariCP and inspect how results are processed. Done means the intermittent NoSuchElementException is identified and queries execute successfully on every attempt.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, postgresql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100