On Mon, 2022-06-27 at 15:12 +0200, Zimoch Dirk wrote:
The problem appears between commit 4ab98081 and 56f05d72. (The two commits in between do not produce stable code.)
Ben did some code refactoring of db_field_log which changed array handling.
In particular in dbEvent.c the following snipped disappeared from db_queue_event_log()
/*
* if we have an event on the queue and both the last
* event on the queue and the current event are emtpy
* (i.e. of type dbfl_type_rec), simply ignore duplicate
* events (saving empty events serves no purpose)
*/
if (pevent->npend > 0u &&
(*pevent->pLastLog)->type == dbfl_type_rec &&
pLog->type == dbfl_type_rec) {
db_delete_field_log(pLog);
UNLOCKEVQUE (ev_que);
return;
}
I have added a debug printf in this code and see that it triggers whenever a frame is dropped. That is about 3 out of 4
frames in my test case.
It is not trivial to put back the code because dbfl_type_rec disappeared from enum dbfl_type too.
diff --git a/modules/database/src/ioc/db/dbEvent.c b/modules/database/src/ioc/db/dbEvent.c
index 0164f55b9..480784d1e 100644
--- a/modules/database/src/ioc/db/dbEvent.c
+++ b/modules/database/src/ioc/db/dbEvent.c
@@ -789,6 +789,18 @@ static void db_queue_event_log (evSubscrip *pevent, db_field_log *pLog)
LOCKEVQUE (ev_que);
+ /* if we have an event on the queue and both the last
+ * event on the queue and the current event are empty,
+ * simply ignore duplicate events.
+ */
+ if (pevent->npend > 0u
+ && !dbfl_has_copy(*pevent->pLastLog)
+ && !dbfl_has_copy(pLog)) {
+ db_delete_field_log(pLog);
+ UNLOCKEVQUE (ev_que);
+ return;
+ }
+
/*
* add to task local event que
*/