Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlt-qnx-system: prevent message loss in high load situations #490

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

alexmohr
Copy link
Contributor

  • Add wait method, which waits up to 5 seconds for buffer space to become available. This method tries to flush the buffer via tcp every 10ms. An error will be logged when there was not enough space. The error shows up in dlt to simplify debugging.
  • improve cmake that more qnx compilers are detected
  • log missing context mapping only once, this greatly reduces noise and the load of the system, as previously the message was logged with every log of an unmapped application

@michael-methner
Copy link
Collaborator

Hello @alexmohr ,
thanks for the patch.
I am totally fine to merge the two items:

  • improve cmake that more qnx compilers are detected
  • log missing context mapping only once, this greatly reduces noise and the load of the system, as previously the message was logged with every log of an unmapped application

I am having a little problem with the change to wait for 5 seconds.

  1. How does slog behave when it is blocked for 5 seconds?
  2. It would be good to have this behavior configurable
    I assume that this situation most likely happens during startup for early messages which are sent while dlt is not yet started.

* Add wait method, which waits up to 5 seconds for buffer space
  to become available.
  This method tries to flush the buffer via tcp every 10ms.
  An error will be logged when there was not enough space.
  The error shows up in dlt to simplify debugging.
* improve cmake that more qnx compilers are detected
* log missing context mapping only once, this greatly reduces
  noise and the load of the system, as previously the
  message was logged with every log of an unmapped application

Signed-off-by: Alexander Mohr <[email protected]>
@alexmohr
Copy link
Contributor Author

1. How does slog behave when it is blocked for 5 seconds?

In our project there's a of stuff logged into slog, especially during startup. We never noticed any issues with this. Unfortunately the qnx manual does not give any further hints on how fast this callback should be done.
Most likely the message are received via qnx message passing and thus should have no influence on the performance of slog itself.

2. It would be good to have this behavior configurable
   I assume that this situation most likely happens during startup for early messages which are sent while dlt is not yet started.

I made it configurable via cmake and changed to the default to 100ms.
The most relevant time is when the the dlt-qnx-system has just started and is receiving all messages from the slog since startup. At this point dlt-daemon is likely to be up already.

@michael-methner
Copy link
Collaborator

Hello @alexmohr ,
thanks for the quick rework.

@michael-methner michael-methner merged commit 0db05d0 into COVESA:master Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants