Skip to content

Report lost events at end of run#96

Open
ngorogiannis wants to merge 4 commits into
tarides:mainfrom
ngorogiannis:no-drop-log
Open

Report lost events at end of run#96
ngorogiannis wants to merge 4 commits into
tarides:mainfrom
ngorogiannis:no-drop-log

Conversation

@ngorogiannis

@ngorogiannis ngorogiannis commented Jun 25, 2026

Copy link
Copy Markdown

Currently, when events are lost a message is printed to stderr, which is flushed.
This can lead to more event loss, as it blocks the event loop.
We change to a simple counter that is printed at the end of the run if positive.

NB stacked on top of #95

@ngorogiannis ngorogiannis changed the title No drop log Report lost events at end of run Jun 25, 2026
@ngorogiannis ngorogiannis marked this pull request as ready for review June 25, 2026 16:34
Comment thread lib/olly_common/launch.ml

let lost_events ring_id num =
Printf.eprintf "[ring_id=%d] Lost %d events\n%!" ring_id num
let lost_events_count = ref 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an Atomic instead, or is it only ever accessed from one Domain?
Atomic.fetch_and_add would returns the old value, so at the cost of doing the sum twice we could detect the overflow and set a separate atomic flag that we've detected one.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only called on one domain. In fact, the callback API doesn't allow for callbacks in multiple domains currently.

@tmcgilchrist

Copy link
Copy Markdown
Collaborator

The change in 29a46b0 is good. Some comments on the changes in #93

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.

3 participants