[ 
https://issues.apache.org/jira/browse/ARROW-17191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17570526#comment-17570526
 ] 

David Li edited comment on ARROW-17191 at 7/24/22 6:36 PM:
-----------------------------------------------------------

The reason is that: sometimes (most times!) gRPC hands us a noncontiguous set 
of slices, which we have to concatenate into a single memory region to use with 
Flight. We use a gRPC function to do this. Also, slices can inline the data 
into the structure directly for small slices. It turns out that after 
concatenation, we can still get an inlined slice, which we weren't properly 
accounting for. And then the inlined slice would have its data overwritten when 
we sliced the buffer. I'm unclear why this is the case, though.


was (Author: lidavidm):
The reason is that: sometimes (most times!) gRPC hands us a noncontiguous set 
of slices, which we have to concatenate into a single memory region to use with 
Flight. We use a gRPC function to do this. Also, slices can inline the data 
into the structure directly for small slices. It turns out that after 
concatenation, we can still get an inlined slice, which we weren't properly 
accounting for. And then the inlined slice would have its data overwritten when 
the reference count was incremented. I'm unclear why this is the case, though.

> [C++] MinGW Flight tests failing 
> ---------------------------------
>
>                 Key: ARROW-17191
>                 URL: https://issues.apache.org/jira/browse/ARROW-17191
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: David Li
>            Assignee: David Li
>            Priority: Major
>
> Noticed across several PRs
> {noformat}
> [ RUN      ] GrpcDataTest.TestDoExchangeError
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:490: Failure
> Value of: _st.IsNotImplemented()
>   Actual: false
> Expected: true
> Expected 'writer->Close()' to fail with NotImplemented, but got IOError: 
> Stream finished before first message sent. gRPC client debug context: 
> UNKNOWN:Error received from peer ipv4:127.0.0.1:52323 
> {created_time:"2022-07-23T01:21:23.785644223+00:00", grpc_status:2, 
> grpc_message:"Stream finished before first message sent"}. Client context: 
> OK. Detail: Failed
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:490: Failure
> Value of: _st.ToString()
> Expected: has substring "Expected error"
>   Actual: "IOError: Stream finished before first message sent. gRPC client 
> debug context: UNKNOWN:Error received from peer ipv4:127.0.0.1:52323 
> {created_time:\"2022-07-23T01:21:23.785644223+00:00\", grpc_status:2, 
> grpc_message:\"Stream finished before first message sent\"}. Client context: 
> OK. Detail: Failed"
> [  FAILED  ] GrpcDataTest.TestDoExchangeError (5 ms)
> [ RUN      ] GrpcDataTest.TestDoExchangeConcurrency
> [       OK ] GrpcDataTest.TestDoExchangeConcurrency (5 ms)
> [ RUN      ] GrpcDataTest.TestDoExchangeUndrained
> [       OK ] GrpcDataTest.TestDoExchangeUndrained (4 ms)
> [ RUN      ] GrpcDataTest.TestIssue5095
> [       OK ] GrpcDataTest.TestIssue5095 (9 ms)
> [----------] 17 tests from GrpcDataTest (891 ms total)
> [----------] 7 tests from GrpcDoPutTest
> [ RUN      ] GrpcDoPutTest.TestInts
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:690: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0L��. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52331 {grpc_message:"Expected app_metadata to be foo bar but 
> got \x00L\xf4\x86\x02\xe0\xa1", grpc_status:3, 
> created_time:"2022-07-23T01:21:23.810734286+00:00"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestInts (4 ms)
> [ RUN      ] GrpcDoPutTest.TestFloats
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:690: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0<���. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52333 {grpc_message:"Expected app_metadata to be foo bar but 
> got \x00<\xee\xc6\x02\xe0\xa1", grpc_status:3, 
> created_time:"2022-07-23T01:21:23.815439591+00:00"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestFloats (4 ms)
> [ RUN      ] GrpcDoPutTest.TestEmptyBatch
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:690: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0���. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52335 {grpc_message:"Expected app_metadata to be foo bar but 
> got \x00\x9c\xef\xa6\x02\xe0\xa1", grpc_status:3, 
> created_time:"2022-07-23T01:21:23.819872813+00:00"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestEmptyBatch (4 ms)
> [ RUN      ] GrpcDoPutTest.TestDicts
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:690: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0\���. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52337 {grpc_message:"Expected app_metadata to be foo bar but 
> got \x00\\\xf0\xc6\x02\xe0\xa1", grpc_status:3, 
> created_time:"2022-07-23T01:21:23.824172893+00:00"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestDicts (4 ms)
> [ RUN      ] GrpcDoPutTest.TestLargeBatch
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:690: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0|��. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52339 {created_time:"2022-07-23T01:21:24.001437714+00:00", 
> grpc_status:3, grpc_message:"Expected app_metadata to be foo bar but got 
> \x00|\xf2\xa6\x02\xe0\xa1"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestLargeBatch (185 ms)
> [ RUN      ] GrpcDoPutTest.TestSizeLimit
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:802: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0\�,�. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52341 {grpc_message:"Expected app_metadata to be foo bar but 
> got \x00\\\xef,\x07\xe0\xa1", grpc_status:3, 
> created_time:"2022-07-23T01:21:24.016917836+00:00"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestSizeLimit (8 ms)
> [ RUN      ] GrpcDoPutTest.TestUndrained
> D:/a/arrow/arrow/cpp/src/arrow/flight/test_definitions.cc:690: Failure
> Failed
> 'writer->Close()' failed with Invalid: Expected app_metadata to be foo bar 
> but got \0���. gRPC client debug context: UNKNOWN:Error received from peer 
> ipv4:127.0.0.1:52343 {created_time:"2022-07-23T01:21:24.022330532+00:00", 
> grpc_status:3, grpc_message:"Expected app_metadata to be foo bar but got 
> \x00\xac\xee\xa6\x02\xe0\xa1"}. Client context: OK
> [  FAILED  ] GrpcDoPutTest.TestUndrained (4 ms) {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to