Skip to content

Check when mismatched sequencing occurs#205

Merged
corbin-phipps merged 5 commits intofeature/dataStreamingfrom
user/corbinphipps/mismatch-sequencing
Mar 4, 2024
Merged

Check when mismatched sequencing occurs#205
corbin-phipps merged 5 commits intofeature/dataStreamingfrom
user/corbinphipps/mismatch-sequencing

Conversation

@corbin-phipps
Copy link
Contributor

Type

  • Bug fix
  • Feature addition
  • Feature update
  • Documentation
  • Build Infrastructure

Side Effects

  • Breaking change
  • Non-functional change

Goals

Fixes #186

Technical Details

  • Check for mismatched sequencing in OnReadDone callbacks and store a list of the unreceived sequence numbers.
  • Return a std::span parameter of the sequence numbers in the client test Await functions.
  • Don't set status to failed if sequence mismatch occurs, just let client handle it how it wants to.

Test Results

All tests pass.

Reviewer Focus

None.

Future Work

None.

Checklist

  • Build target all compiles cleanly.
  • clang-format and clang-tidy deltas produced no new output.
  • Newly added functions include doxygen-style comment block.

@corbin-phipps corbin-phipps requested a review from a team as a code owner March 4, 2024 16:42
@corbin-phipps corbin-phipps merged commit c454a9b into feature/dataStreaming Mar 4, 2024
@corbin-phipps corbin-phipps deleted the user/corbinphipps/mismatch-sequencing branch March 4, 2024 17:00

grpc::Status
DataStreamReader::Await(uint32_t* numberOfDataBlocksReceived, DataStreamOperationStatus* operationStatus)
DataStreamReader::Await(uint32_t* numberOfDataBlocksReceived, DataStreamOperationStatus* operationStatus, std::span<uint32_t> lostDataBlockSequenceNumbers)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand the usage of this variable. The std::span is being passed as a value copy, but it seems like this is intended to be used as an output variable instead. If that's true, this should be a reference instead (std::span<uint32_t>&). Have I misunderstood something here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, should definitely be a reference


*numberOfDataBlocksReceived = m_numberOfDataBlocksReceived;
*operationStatus = m_readData.status();
lostDataBlockSequenceNumbers = std::span<uint32_t>(std::data(m_lostDataBlockSequenceNumbers), std::size(m_lostDataBlockSequenceNumbers));
Copy link
Contributor

Choose a reason for hiding this comment

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

This is modifying the value passed to the function, then not used. Was lostDataBlockSequenceNumbers meant to be a reference such that this update's the caller's arg?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, should be a reference. Will update

REQUIRE(status.ok());
REQUIRE(numberOfDataBlocksReceived == fixedNumberOfDataBlocksToStream);
REQUIRE(operationStatus.code() == DataStreamOperationStatusCodeSucceeded);
REQUIRE(lostDataBlockSequenceNumbers.empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

This will always be true since a copy of lostDataBlockSequenceNumbers is passed in.

@abeltrano abeltrano mentioned this pull request Mar 5, 2024
10 tasks
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.

2 participants