fix(shmem): refuse to send an empty Parts

- zeromq refuses an empty Parts with TransferCode::error; shmem sent a
  message with zero parts and returned 0, and the receiver got a
  Receive() with zero parts
- Refuse it in shmem too, with the same warning
- Enable PartsTransfer.EmptyPartsIsRefused
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-04 20:32:00 +00:00
committed by Dennis Klein
parent 50387fe5cc
commit 102cdaf40e
7 changed files with 14 additions and 16 deletions

View File

@@ -209,8 +209,13 @@ class Socket final : public fair::mq::Socket
}
int elapsed = 0;
// meta msg format: | n | MetaHeader 1 | ... | MetaHeader n | padded to fMetadataMsgSize |
auto const n = msgVec.size();
if (n == 0) { // same as the zeromq transport
LOG(warn) << "Will not send empty vector";
return static_cast<int>(TransferCode::error);
}
// meta msg format: | n | MetaHeader 1 | ... | MetaHeader n | padded to fMetadataMsgSize |
zmq::ZMsg zmqMsg(std::max(fMetadataMsgSize, sizeof(std::size_t) + n * sizeof(MetaHeader)));
auto meta_n = static_cast<std::size_t*>(zmqMsg.Data());