Skip to content

Commit e4e55f3

Browse files
committed
impl(bigtable): error when read_buffer is not empty and stream finishes
1 parent f41cad5 commit e4e55f3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

google/cloud/bigtable/ci/run_conformance_tests_proxy_bazel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ exit_status=$?
5050
# Run all the ExecuteQuery tests that either work or we plan to skip such as
5151
# CloseClient
5252
go test -v \
53-
-run "TestExecuteQuery|TestExecuteQuery_PlanRefresh$|TestExecuteQuery_PlanRefresh_WithMetadataChange|TestExecuteQuery_PlanRefresh_Retries|TestExecuteQuery_PlanRefresh_RecoversAfterPermanentError" \
53+
-run "TestExecuteQuery|TestExecuteQuery_PlanRefresh$|TestExecuteQuery_PlanRefresh_WithMetadataChange|TestExecuteQuery_PlanRefresh_Retries|TestExecuteQuery_PlanRefresh_RecoversAfterPermanentError|TestExecuteQuery_FailsOnSuccesfulStreamWithNoToken" \
5454
-skip "CloseClient|FailsOnEmptyMetadata|FailsOnExecuteQueryMetadata|FailsOnInvalidType|FailsOnNotEnoughData|FailsOnNotEnoughDataWithCompleteRows|FailsOnSuccesfulStreamWithNoToken|ChecksumMismatch|FailsOnTypeMismatch|FailsOnTypeMismatchWithinMap|FailsOnTypeMismatchWithinArray|FailsOnTypeMismatchWithinStruct|FailsOnStructMissingField|TestExecuteQuery_PlanRefresh_AfterResumeTokenCausesError|TestExecuteQuery_RetryTest_WithPlanRefresh|TestExecuteQuery_PlanRefresh_RespectsDeadline" \
5555
-proxy_addr=:9999
5656
exit_status=$?
@@ -67,7 +67,7 @@ exit_status=$?
6767

6868
# Stream reading tests b/461232110
6969
#go test -v \
70-
# -run "FailsOnNotEnoughData|FailsOnNotEnoughDataWithCompleteRows|FailsOnSuccesfulStreamWithNoToken|ChecksumMismatch" \
70+
# -run "FailsOnNotEnoughData|FailsOnNotEnoughDataWithCompleteRows|ChecksumMismatch" \
7171
# -proxy_addr=:9999
7272
#exit_status=$?
7373

google/cloud/bigtable/internal/partial_result_set_source.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ Status PartialResultSetSource::ReadFromStream() {
141141
return ProcessDataFromStream(result_set.result);
142142
}
143143
state_ = State::kFinished;
144-
// The buffered_rows_ is expected to be empty because the last successful
145-
// read would have had a sentinel resume_token, causing
144+
// buffered_rows_ and read_buffer_ are expected to be empty because the last
145+
// successful read would have had a sentinel resume_token, causing
146146
// ProcessDataFromStream to commit them.
147-
if (!buffered_rows_.empty()) {
147+
if (!buffered_rows_.empty() || !read_buffer_.empty()) {
148148
return internal::InternalError("Stream ended with uncommitted rows.",
149149
GCP_ERROR_INFO());
150150
}
@@ -180,7 +180,8 @@ Status PartialResultSetSource::ProcessDataFromStream(
180180
} else {
181181
read_buffer_.clear();
182182
buffered_rows_.clear();
183-
return internal::InternalError("Failed to parse ProtoRows from buffer");
183+
return internal::InternalError("Failed to parse ProtoRows from buffer",
184+
GCP_ERROR_INFO());
184185
}
185186
}
186187

0 commit comments

Comments
 (0)