Skip to content
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

fix: synchronize lazy ResultSet decoding #3267

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

olavloite
Copy link
Collaborator

Using one of the options DecodeMode.LAZY_PER_ROW or DecodeMode.LAZY_PER_COLUMN in combination with multi-threaded access to the ResultSet could lead to ClassCastExceptions, as the underlying decode methods were not synchronized. This could lead to multiple threads trying to access either the raw proto data or the decoded data at the same time, and expecting to get the other type of data.

Using one of the options DecodeMode.LAZY_PER_ROW or DecodeMode.LAZY_PER_COLUMN
in combination with multi-threaded access to the ResultSet could lead to
ClassCastExceptions, as the underlying decode methods were not synchronized.
This could lead to multiple threads trying to access either the raw proto data
or the decoded data at the same time, and expecting to get the other type of
data.
@olavloite olavloite requested a review from a team as a code owner August 12, 2024 13:56
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Aug 12, 2024
@rahul2393 rahul2393 merged commit 4219cf8 into main Aug 22, 2024
33 checks passed
@rahul2393 rahul2393 deleted the synchronize-resultset-decoding branch August 22, 2024 02:10
lqiu96 pushed a commit that referenced this pull request Sep 10, 2024
Using one of the options DecodeMode.LAZY_PER_ROW or DecodeMode.LAZY_PER_COLUMN
in combination with multi-threaded access to the ResultSet could lead to
ClassCastExceptions, as the underlying decode methods were not synchronized.
This could lead to multiple threads trying to access either the raw proto data
or the decoded data at the same time, and expecting to get the other type of
data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants