You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "spanglerco (via GitHub)" <gi...@apache.org> on 2025/09/23 13:58:47 UTC
[I] ArrowStreamReader.GetSchema (async) does synchronous IO when stream is empty [arrow-dotnet]
spanglerco opened a new issue, #80:
URL: https://github.com/apache/arrow-dotnet/issues/80
### Describe the bug, including details regarding any error messages, version, and platform.
When given an empty stream, calls to `ArrowStreamReader.GetSchema()` first calls `ArrowStreamReaderImplementation.GetSchemaAsync()` and then retrieves the `Schema` property. When the stream is empty, `GetSchemaAsync` [returns early](https://github.com/apache/arrow-dotnet/blob/425bc83d1800637b61775d257216b7bfe1a6ca25/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs#L166) without setting `_schema`.
Then, the [`Schema` property getter](https://github.com/apache/arrow-dotnet/blob/425bc83d1800637b61775d257216b7bfe1a6ca25/src/Apache.Arrow/Ipc/ArrowReaderImplementation.cs#L39), seeing that `_schema` is still null, calls `ArrowStreamReaderImplementation.GetSchema()` (the synchronous version). This ends up performing a synchronous read on the (still empty) stream.
In particular, this is an issue when the stream is an HTTP request body from Kestrel (ASP.NET), which blocks synchronous IO by default. The result is an `InvalidOperationException`.
I'm willing to provide a PR if someone else doesn't get to it. My initial reaction would be to change `ArrowReaderImplementation.GetSchemaAsync()` to return a `ValueTask<Schema>`, but that's not the only possible solution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ArrowStreamReader.GetSchema (async) does synchronous IO when stream is empty [arrow-dotnet]
Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on issue #80:
URL: https://github.com/apache/arrow-dotnet/issues/80#issuecomment-3324391043
What would you say is the correct behavior here? To return a null `Schema` to the external caller when `ArrowStreamReaderImplementation.ReadMessageLengthAsync` returns zero?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ArrowStreamReader.GetSchema (async) does synchronous IO when stream is empty [arrow-dotnet]
Posted by "spanglerco (via GitHub)" <gi...@apache.org>.
spanglerco commented on issue #80:
URL: https://github.com/apache/arrow-dotnet/issues/80#issuecomment-3324408938
That's what it currently does (after the synchronous IO), which seems reasonable to me. It used to throw an exception until apache/arrow#47098.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ArrowStreamReader.GetSchema (async) does synchronous IO when stream is empty [arrow-dotnet]
Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher closed issue #80: ArrowStreamReader.GetSchema (async) does synchronous IO when stream is empty
URL: https://github.com/apache/arrow-dotnet/issues/80
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org