Skip to content

Commit ca33a40

Browse files
Increase the poll rate for BDX diagnostic log downloads. (#33741)
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.
1 parent 994a98d commit ca33a40

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/protocols/bdx/BdxTransferDiagnosticLog.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ namespace {
2525
// Max block size for the BDX transfer.
2626
constexpr uint32_t kMaxBdxBlockSize = 1024;
2727

28+
// How often we poll our transfer session. Sadly, we get allocated on
29+
// unsolicited message, which makes it hard for our clients to configure this.
30+
// But the default poll interval is 500ms, which makes log downloads extremely
31+
// slow.
32+
constexpr System::Clock::Timeout kBdxPollInterval = System::Clock::Milliseconds32(50);
33+
2834
// Timeout for the BDX transfer session..
2935
constexpr System::Clock::Timeout kBdxTimeout = System::Clock::Seconds16(5 * 60);
3036
constexpr TransferRole kBdxRole = TransferRole::kReceiver;
@@ -95,7 +101,8 @@ CHIP_ERROR BdxTransferDiagnosticLog::OnMessageReceived(Messaging::ExchangeContex
95101
mTransferProxy.SetFabricIndex(fabricIndex);
96102
mTransferProxy.SetPeerNodeId(peerNodeId);
97103
auto flags(TransferControlFlags::kSenderDrive);
98-
ReturnLogErrorOnFailure(Responder::PrepareForTransfer(mSystemLayer, kBdxRole, flags, kMaxBdxBlockSize, kBdxTimeout));
104+
ReturnLogErrorOnFailure(
105+
Responder::PrepareForTransfer(mSystemLayer, kBdxRole, flags, kMaxBdxBlockSize, kBdxTimeout, kBdxPollInterval));
99106
}
100107

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

0 commit comments

Comments
 (0)