-
Notifications
You must be signed in to change notification settings - Fork 64
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
mcap-record: Fix race condition when adding messages #598
mcap-record: Fix race condition when adding messages #598
Conversation
data: new Uint8Array(event.data.buffer, event.data.byteOffset, event.data.byteLength), | ||
}); | ||
|
||
// If we can't acquire the lock, we will drop the message to avoid potential OOM issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could have a setting for this? It could be useful in some situations to record everything even if it takes longer than realtime. We should make sure that after ^C the writer still gets closed cleanly — ideally finishing everything that was in the write queue already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@jtbandes ping |
Public-Facing Changes
mcap-record: Fix race condition when adding messages
Description
Does not directly call
writer.addMessage
in the websocket message handler but instead pushes it to a queue. This makes sure that we do not callwriter.addMessage
concurrently which could happen due to a certainaddMessage
taking longer when a chunk is ready to be compressed & written. This PR also allows to set the message queue size and to opt out of chunk compression.Fixes #592
Resolves FG-5775