How to Handle le_avdata_PushRecord Handler Failure

I posted here in the Legato forum https://forum.legato.io/t/le-avdata-pushrecord-handler-failure/4440/5 and I’m still ocasionally getting a le_avdata_PushRecord handler with a value of LE_AVDATA_PUSH_FAILED.

The Legato documentation doesn’t really talk about how a le_avdata_PushRecord handler failure should be dealt with. What should be done in this situation?

Thanks,

Have you attempted to retry the call tole_avdata_PushRecord() with the same record reference? I have only skimmed the code, but it seems that the reference is only cleared when the data is successfully pushed.

@dfrey

Thanks for looking into this but I too have looked at the code and I don’t think works as you initially thought. Please see below:

  1. Once a record has successfully pushed or queued then the record is reset. See avcDaemon/timeseriesData.c line #1597
  2. It doesn’t matter if a push handler is called with a status of LE_AVDATA_PUSH_SUCCESS or LE_AVDATA_PUSH_FAILED the item on the push linked list is removed from the list and the data is lost at that point. See avcDaemon/push.c lines #105 to #122.

The initial call to le_avdata_PushRecord doesn’t fail, it’s the callback handler that reports the fail. My interpretation of the code is in this situation the record will be lost.

I would really appreciate your thoughts on this.

Assuming you’re correct about the behavior described above, then that seems like a design flaw. I guess you could create you own parallel data structure to record data points into and keep your data until you get a LE_AVDATA_PUSH_SUCCESS. If you get a LE_AVDATA_PUSH_FAILED, then you could construct a new record and try to push again. This seems like a non-trivial amount of work and a huge hack though. I suggest trying to escalate the issue with the Legato team.

@dfrey

The Legato team seems to know what’s causing the handler failure but nobody has been able to comment on the fact the records are deleted. You can see some of the details in the link in my initial post.

I like your idea and totally agree on the non-trival amount of work which is why I was hoping this would be handled by the Legato platform services.