Make sure we clear the logger observer before starting a new session#1387
Open
ryanzhang22 wants to merge 2 commits into
Open
Make sure we clear the logger observer before starting a new session#1387ryanzhang22 wants to merge 2 commits into
ryanzhang22 wants to merge 2 commits into
Conversation
…rch#1383) Summary: Currently, we mark all areas where we want to indicate stage completion with `UST_LOGGER_MARK_COMPLETED`. This macro routes us to the UST logger `write` method which keep a running list of all LOG(ERROR) messages. If no ERROR messages have been logged, we'll mark the stage as a success. Otherwise, we will include the error message in the Scuba write. With this setup it's pretty easy for us to miss an exit path, especially in the post-processing path where we have a bunch of early exit branches. This change introduces a `USTLoggerStageGuard` to help automatically manage stage exit without needing to explicitly remember to mark `UST_LOGGER_MARK_COMPLETED`. Note that this doesn't help us capture cases where something failed catastrophically and the process immediately exits. Many of these callsites were already pretty well instrumented, this just makes stuff a little cleaner. Differential Revision: D102829439
Summary: Currently, we don't reset the UST logger between sync (auto-trace)/async (on-demand) runs, so the data from one run can pollute the other. In particular, if we have an async then sync run, the sync run's UST logs will have artifacts from the async run. Before sync/async's `configure` method, we add a `resetLoggerObservers` call. We add it here because `configure` is when we know the request was accepted. Differential Revision: D103278391
|
@ryanzhang22 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103278391. |
sanrise
approved these changes
May 5, 2026
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.
Summary:
Currently, we don't reset the UST logger between sync (auto-trace)/async (on-demand) runs, so the data from one run can pollute the other. In particular, if we have an async then sync run, the sync run's UST logs will have artifacts from the async run.
Before sync/async's
configuremethod, we add aresetLoggerObserverscall. We add it here becauseconfigureis when we know the request was accepted.Differential Revision: D103278391