Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces delayed initialization buffering so prior-run crash logs can replay before current-session logs.
Changes:
- Replaces
PreConfigBufferwith prioritized, capacity-awareInitBuffer. - Adds runtime-configurable replay delays and crash-pending hints.
- Adds tests for delay, prioritization, and capacity behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
bd-runtime/src/runtime.rs |
Defines replay-delay runtime flags. |
bd-logger/src/test/setup.rs |
Supports custom runtime values in tests. |
bd-logger/src/pre_config_buffer.rs |
Removes the old buffer. |
bd-logger/src/pre_config_buffer_test.rs |
Removes obsolete tests. |
bd-logger/src/logging_state.rs |
Integrates InitBuffer into logging state. |
bd-logger/src/logger.rs |
Exposes crash-pending hints. |
bd-logger/src/lib.rs |
Registers the new buffer module. |
bd-logger/src/init_buffer.rs |
Implements delayed, prioritized buffering and metrics. |
bd-logger/src/init_buffer_test.rs |
Tests buffer limits and prioritization. |
bd-logger/src/builder.rs |
Pins the async buffer future. |
bd-logger/src/async_log_buffer.rs |
Schedules and performs delayed replay. |
bd-logger/src/async_log_buffer_test.rs |
Tests replay timing and ordering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1395
to
+1400
| () = maybe_await_map(self.pending_init_buffer.as_mut(), |pending_init_buffer| async { | ||
| maybe_await(pending_init_buffer.replay_sleep()).await; | ||
| }) => { | ||
| self | ||
| .replay_init_buffer(&state_store, ReplayReason::Scheduled, false) | ||
| .await; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evolves the current PreConfigBuffer into a more general InitBuffer that is used to buffer logs for an additional configured time after config load has occurred in order to give the system time to respond to a crash log that needs to be associated with the previous process session.
Upon config load (cached or via API), the InitBuffer buffers for an additional runtime configured period before replaying previous session logs before any of the regular logs. This provides a small buffer for which previous session logs can be replayed in the correct order to avoid thrashing the workflow engine.
Additionally a function is exposed to the platform layer that allows the layer to indicate that a crash report is inbound - this further extends the delay by another configurable amount. Both iOS and Android is able to determine that there is a crash before receiving or parsing the entire report, so this allows us to extend the buffering period for the small subset of app starts where we believe there to be an inbound crash report.
While buffering in the InitBuffer if the buffer capacity is reached we'll end up replaying the logs early. This is a failsafe to avoid dropping logs.
Fixes BIT-9304