Skip to content

Commit 0a68680

Browse files
committed
Back out "DPL: fix rate limiting handling (#14255)"
Original commit changeset: 1bcf367
1 parent bb740a4 commit 0a68680

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

Framework/Core/src/CommonDataProcessors.cxx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,16 @@
3030
#include "Framework/RuntimeError.h"
3131
#include "Framework/RateLimiter.h"
3232
#include "Framework/PluginManager.h"
33-
#include "Framework/Signpost.h"
3433
#include <Monitoring/Monitoring.h>
3534

3635
#include <fairmq/Device.h>
37-
#include <uv.h>
3836
#include <fstream>
3937
#include <functional>
4038
#include <memory>
4139
#include <string>
4240

4341
using namespace o2::framework::data_matcher;
4442

45-
// Special log to track callbacks we know about
46-
O2_DECLARE_DYNAMIC_LOG(callbacks);
47-
4843
namespace o2::framework
4944
{
5045

@@ -150,46 +145,27 @@ DataProcessorSpec CommonDataProcessors::getGlobalFairMQSink(std::vector<InputSpe
150145

151146
void retryMetricCallback(uv_async_t* async)
152147
{
153-
O2_SIGNPOST_ID_FROM_POINTER(cid, callbacks, async);
154-
O2_SIGNPOST_EVENT_EMIT(callbacks, cid, "rate-limiting", "Attempting again propagating rate-limiting information.");
155-
156-
// Check if this is a source device
157148
static size_t lastTimeslice = -1;
158149
auto* services = (ServiceRegistryRef*)async->data;
159150
auto& timesliceIndex = services->get<TimesliceIndex>();
160151
auto* device = services->get<RawDeviceService>().device();
161152
auto channel = device->GetChannels().find("metric-feedback");
162153
auto oldestPossingTimeslice = timesliceIndex.getOldestPossibleOutput().timeslice.value;
163154
if (channel == device->GetChannels().end()) {
164-
O2_SIGNPOST_EVENT_EMIT(callbacks, cid, "rate-limiting", "Could not find metric-feedback channel.");
165155
return;
166156
}
167157
fair::mq::MessagePtr payload(device->NewMessage());
168158
payload->Rebuild(&oldestPossingTimeslice, sizeof(int64_t), nullptr, nullptr);
169159
auto consumed = oldestPossingTimeslice;
170160

171-
size_t start = uv_hrtime();
172161
int64_t result = channel->second[0].Send(payload, 100);
173-
size_t stop = uv_hrtime();
174162
// If the sending worked, we do not retry.
175-
if (result <= 0) {
176-
// Forcefully slow down in case FairMQ returns earlier than expected...
177-
int64_t ellapsed = (stop - start) / 1000000;
178-
if (ellapsed < 100) {
179-
O2_SIGNPOST_EVENT_EMIT(callbacks, cid, "rate-limiting",
180-
"FairMQ returned %llu earlier than expected. Sleeping %llu ms more before, retrying.",
181-
result, ellapsed);
182-
uv_sleep(100 - ellapsed);
183-
} else {
184-
O2_SIGNPOST_EVENT_EMIT(callbacks, cid, "rate-limiting",
185-
"FairMQ returned %llu, unable to send last consumed timeslice to source for %llu ms, retrying.", result, ellapsed);
186-
}
163+
if (result != 0) {
187164
// If the sending did not work, we keep trying until it actually works.
188165
// This will schedule other tasks in the queue, so the processing of the
189166
// data will still happen.
190167
uv_async_send(async);
191168
} else {
192-
O2_SIGNPOST_EVENT_EMIT(callbacks, cid, "rate-limiting", "Send %llu bytes, Last timeslice now set to %zu.", result, consumed);
193169
lastTimeslice = consumed;
194170
}
195171
}

0 commit comments

Comments
 (0)