[ES-1436915] Modify an e2e test to iterate over the rs in a separate thread#807
Merged
Conversation
This will help surface any thread-safety issues like state propagation, etc. Customers can use the first-class objects like Statement, ResultSet in a separate thread and the test now tries to emulate the same
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates an end-to-end test to iterate over a ResultSet in a separate thread, aiming to surface potential thread-safety issues in the use of first-class objects such as Statement and ResultSet. Key changes include updating the test method signature to throw InterruptedException, creating a separate thread to iterate the result set, and capturing any exceptions occurring in that thread using an AtomicReference.
Comments suppressed due to low confidence (1)
src/test/java/com/databricks/jdbc/integration/fakeservice/tests/MultiChunkExecutionIntegrationTests.java:43
- [nitpick] Consider renaming 'thread' to a more descriptive name, such as 'resultProcessingThread', to clarify its role in this test.
Thread thread = new Thread(
…s/MultiChunkExecutionIntegrationTests.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
vikrantpuppala
approved these changes
Apr 25, 2025
samikshya-db
approved these changes
Apr 25, 2025
Collaborator
|
Thanks for adding this, J ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This will help identify potential thread-safety issues, such as problems with state propagation and context management. In this scenario, customers can interact with first-class JDBC objects like Statement and ResultSet from a separate thread, while the JDBC connection object itself is managed in a different thread. The test is designed to simulate this type of multithreaded environment, ensuring that the system can handle concurrent access to these objects without issues. By doing so, it helps uncover any synchronization problems or unintended side effects that may arise when JDBC components are accessed from multiple threads.
Testing
The test is expected to fail now due to a bug in the implementation of DatabricksContextHolder.
Additional Notes to the Reviewer