Skip to content

Conversation

@wesm
Copy link
Member

@wesm wesm commented Sep 11, 2019

No description provided.

@wesm wesm requested a review from emkornfield September 11, 2019 22:40
Copy link
Contributor

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@wesm
Copy link
Member Author

wesm commented Sep 12, 2019

Trying to reproduce the failure that's occurring in Ursabot Python 2.7 build

@wesm
Copy link
Member Author

wesm commented Sep 12, 2019

I can repro, not sure why it occurs in Python 2.7 but not 3.6/7

@wesm
Copy link
Member Author

wesm commented Sep 12, 2019

@pitrou @emkornfield I found that Python 2.7 wasn't returning aligned memory from io.BytesIO and so I am making the metadata read path copy the metadata unconditionally if it is unaligned (even if the IPC format is implemented properly)

Copy link
Member

@BryanCutler BryanCutler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

namespace internal {

// This 0xFFFFFFFF value is the first 4 bytes of a valid IPC message
constexpr int32_t kIpcContinuationToken = -1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for some reason i thought there were linkage issues in C++11 using constexpr in a header.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr implies inline/static linkage. It's not an error (though I sort of expected it to be) in clang to declare

extern constexpr int32_t kIpcContinuationToken = -1;

... if you want to declare something constexpr within this translation unit but also export it as a symbol for other translation units, but the expectation is that you'll just include the header into whatever TU needs that constant.

Copy link
Contributor

@emkornfield emkornfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me, feel free to merge when build passes.

@pitrou
Copy link
Member

pitrou commented Sep 12, 2019

I found that Python 2.7 wasn't returning aligned memory from io.BytesIO

Interesting. Python 3 doesn't make any such guarantee either, but probably it turns out ok in the current bytes object implementation.

return Write(&kEos, sizeof(kEos));
constexpr int32_t kZeroLength = 0;
if (!options_.write_legacy_ipc_format) {
RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(int32_t)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(int32_t)));
RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(internal::kIpcContinuationToken)));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to let this one slide -- I kind of prefer int32_t for the documentation aspect

wesm added a commit that referenced this pull request Sep 12, 2019
…e C++ implementation

Closes #5361 from wesm/two-part-eos and squashes the following commits:

cd632ff <Wes McKinney> Copy metadata unconditionally since input buffers may not start on aligned offsets
70d1b3a <Wes McKinney> Remove unneeded header
4071528 <Wes McKinney> Use 2-part EOS in C++, update in format docs. Write old EOS if option is set

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
@wesm wesm closed this Sep 12, 2019
wesm added a commit that referenced this pull request Sep 13, 2019
…e C++ implementation

Closes #5361 from wesm/two-part-eos and squashes the following commits:

cd632ff <Wes McKinney> Copy metadata unconditionally since input buffers may not start on aligned offsets
70d1b3a <Wes McKinney> Remove unneeded header
4071528 <Wes McKinney> Use 2-part EOS in C++, update in format docs. Write old EOS if option is set

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
pprudhvi pushed a commit to pprudhvi/arrow that referenced this pull request Sep 16, 2019
…e C++ implementation

Closes apache#5361 from wesm/two-part-eos and squashes the following commits:

cd632ff <Wes McKinney> Copy metadata unconditionally since input buffers may not start on aligned offsets
70d1b3a <Wes McKinney> Remove unneeded header
4071528 <Wes McKinney> Use 2-part EOS in C++, update in format docs. Write old EOS if option is set

Authored-by: Wes McKinney <wesm+git@apache.org>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants