Repository navigation
Hand the scheduler's io_read the caller's part of the read buffer - #9806
Open
sampokuokkanen wants to merge 1 commit into
Open
sampokuokkanen wants to merge 1 commit into
sampokuokkanen wants to merge 1 commit into
Conversation
readInternal can pass the scheduler hooks a ByteBuffer that starts partway into its array. The hooks wrapped it in an IO::Buffer, which counts from zero, so a scheduler's io_read wrote to the start of the array while the caller looked for the data further in. Under async, File.read returned NUL bytes, as in async's File#flush test. Slice the ByteBuffer first, so the IO::Buffer starts where the caller's data goes. The pread, write and pwrite hooks get the same fix.
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.
A very simple fix, but MRI has no tests for offset buffers. After this, Async's file/test.rb passes.
readInternalcan pass the scheduler hooks a ByteBuffer that starts partway into its array. The hooks wrapped it in an IO::Buffer, which counts from zero, so a scheduler'sio_readwrote to the start of the array while the caller looked for the data further in. Under async,File.readreturned NUL bytes, as in async'sFile#flushtest.Slice the ByteBuffer first, so the IO::Buffer starts where the caller's data goes. The pread, write and pwrite hooks get the same fix.