Skip to content

Commit 0d94146

Browse files
committed
DPL: attempt to have some dropping logic which does not break test
I suspect what is happening in the test is the consumers start too late (and the lossy policy drops messages on the sender side when that happens). This should avoid the problem by increasing the delay up to 1 second, before switching to lossy, giving enough time to the consumers to start.
1 parent b764ede commit 0d94146

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Framework/Core/src/SendingPolicy.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ std::vector<SendingPolicy> SendingPolicy::createDefaultPolicies()
5454
// We count the number of consecutively dropped messages.
5555
// If we have more than 10, we switch to a completely
5656
// non-blocking approach.
57-
int64_t timeout = 50;
57+
int64_t timeout = 100;
5858
if (state.droppedMessages == 10 + 1) {
5959
LOG(warning) << "Failed to send 10 messages with 10ms timeout in a row, switching to completely non-blocking mode.";
6060
}
6161
if (state.droppedMessages == 0) {
62-
timeout = 50;
62+
timeout = 100;
6363
}
6464
if (state.droppedMessages > 10) {
6565
timeout = 0;
6666
}
67-
int64_t result = info.channel.Send(parts, timeout);
67+
int64_t result = info.channel.Send(parts, timeout*(state.droppedMessages+1));
6868
if (result >= 0) {
6969
state.droppedMessages = 0;
7070
} else if (state.droppedMessages < std::numeric_limits<decltype(state.droppedMessages)>::max()) {

0 commit comments

Comments
 (0)