-
Notifications
You must be signed in to change notification settings - Fork 134
feat(jdbc): add retry mechanism for Arrow and JSON result streams #4100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @keshavdandeva, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness of the BigQuery JDBC driver by introducing comprehensive retry mechanisms for both Arrow and JSON result streams. These changes ensure that transient network issues or temporary service unavailability during data retrieval and pagination are automatically handled, leading to a more resilient and reliable data fetching experience for users. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a retry mechanism for both Arrow and JSON result streams, which is a great enhancement for resiliency. The implementation looks mostly correct, but I've found a few issues. There's a potential infinite loop in the retry logic for JSON streams under specific interruption conditions. Additionally, there are some inconsistencies in the new logging statements, and in several places, the change from LOG.log to LOG.warning has led to the loss of stack traces in the logs, which could make debugging more difficult. I've provided specific comments and suggestions to address these points.
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a valuable retry mechanism for both Arrow and JSON result streams, which will improve the robustness of the JDBC driver against transient network issues. The implementation looks solid, with configurable timeout and delay settings. I've identified one high-severity issue in the JSON stream handling that could lead to a hanging thread, and I've also suggested some improvements to the logging statements for better readability and consistency. Please apply the logging feedback to all similar new log statements.
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request introduces retry mechanisms for both Arrow and JSON result streams in BigQueryStatement.java. This enhances the robustness of data retrieval by handling transient network interruptions and session expirations. Additionally, logging for InterruptedException has been improved in several areas, providing more detailed information upon interruption.
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryStatement.java
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a retry mechanism for both Arrow and JSON result streams, aiming to improve the robustness of data fetching. However, a critical vulnerability has been identified in the JSON stream handling within runNextPageTaskAsync. The current implementation lacks a finally block to ensure the end-of-stream marker is always sent, which can lead to permanent thread hangs and potential Denial of Service if exceptions occur during result fetching. Additionally, there are medium-severity issues in the Arrow stream implementation related to logging and exception handling consistency. Addressing these points is crucial for the reliability and security of the new retry mechanism.
b/473629793