Skip to content

Commit

Permalink
Increase the poll rate for BDX diagnostic log downloads. (#33741)
Browse files Browse the repository at this point in the history
The default rate used by bdx::Responder is once every 500ms, which means you
maybe manage to get 1kB/s of log through the network.

We should allow this process to go faster.  Switch to once every 50ms, to match
all the other BDX transfers we have around that poll like this.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Jul 24, 2024
1 parent 2b1c0bd commit 1466580
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/protocols/bdx/BdxTransferDiagnosticLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ namespace {
// Max block size for the BDX transfer.
constexpr uint32_t kMaxBdxBlockSize = 1024;

// How often we poll our transfer session. Sadly, we get allocated on
// unsolicited message, which makes it hard for our clients to configure this.
// But the default poll interval is 500ms, which makes log downloads extremely
// slow.
constexpr System::Clock::Timeout kBdxPollInterval = System::Clock::Milliseconds32(50);

// Timeout for the BDX transfer session..
constexpr System::Clock::Timeout kBdxTimeout = System::Clock::Seconds16(5 * 60);
constexpr TransferRole kBdxRole = TransferRole::kReceiver;
Expand Down Expand Up @@ -95,7 +101,8 @@ CHIP_ERROR BdxTransferDiagnosticLog::OnMessageReceived(Messaging::ExchangeContex
mTransferProxy.SetFabricIndex(fabricIndex);
mTransferProxy.SetPeerNodeId(peerNodeId);
auto flags(TransferControlFlags::kSenderDrive);
ReturnLogErrorOnFailure(Responder::PrepareForTransfer(mSystemLayer, kBdxRole, flags, kMaxBdxBlockSize, kBdxTimeout));
ReturnLogErrorOnFailure(
Responder::PrepareForTransfer(mSystemLayer, kBdxRole, flags, kMaxBdxBlockSize, kBdxTimeout, kBdxPollInterval));
}

return TransferFacilitator::OnMessageReceived(ec, payloadHeader, std::move(payload));
Expand Down

0 comments on commit 1466580

Please sign in to comment.