Skip to content

Commit 2e46494

Browse files
Make sure to print an error if data is lost while terminating DPL proxy
Amending PR #3801. Checking for the requested change of device state before dispatching messages might silently drop data. Have to ensure that message are always dispatched, and if the sending does not succeed an error message is printed. Only after that the pending device state change is checked and can break the loop.
1 parent ad852da commit 2e46494

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

Framework/Core/src/ExternalFairMQDeviceProxy.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void sendOnChannel(FairMQDevice& device, FairMQParts& messages, std::string cons
6969
// TODO: we might want to treat this error condition some levels higher up, but for
7070
// the moment its an appropriate solution. The important thing is not to drop
7171
// messages and to be informed about the congestion.
72-
while (device.NewStatePending() == false && device.Send(messages, channel, index, timeout) < 0) {
72+
while (device.Send(messages, channel, index, timeout) < 0) {
7373
if (timeout == 0) {
7474
timeout = 1;
7575
} else if (timeout < maxTimeout) {
@@ -83,6 +83,15 @@ void sendOnChannel(FairMQDevice& device, FairMQParts& messages, std::string cons
8383
timeout += 1;
8484
}
8585
}
86+
if (device.NewStatePending()) {
87+
LOG(ERROR) << "device state change is requested, dropping " << messages.Size() << " pending message(s)\n"
88+
<< "on channel " << channel << "\n"
89+
<< "ATTENTION: DATA IS LOST! Could not dispatch data to downstream consumer(s), check if\n"
90+
<< "consumers have been terminated too early";
91+
// make sure we disable the warning below
92+
timeout = maxTimeout + 1;
93+
break;
94+
}
8695
}
8796
if (timeout > 0 && timeout <= maxTimeout) {
8897
LOG(WARNING) << "dispatching on channel " << channel << " was delayed by " << timeout << " ms";

0 commit comments

Comments
 (0)