Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/buck2_env/src/soft_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ pub fn handle_soft_error(
options.quiet = false;
}

let is_deprecation = options.deprecation;

// We want to limit each error to appearing at most 10 times in a build (no point spamming people)
if count.fetch_add(1, Ordering::SeqCst) < 10 {
if let Some(handler) = HANDLER.get() {
Expand All @@ -293,9 +295,9 @@ pub fn handle_soft_error(

// @oss-disable: let is_open_source = false;
let is_open_source = true; // @oss-enable
if is_open_source {
// We don't log these, and we have no legacy users, and they might not upgrade that often,
// so lets just break open source things immediately.
if is_open_source && is_deprecation {
// Deprecation warnings should be hard errors in OSS since there are
// no legacy users that need the grace period.
return Err(err);
}

Expand Down
10 changes: 4 additions & 6 deletions app/buck2_execute_impl/src/sqlite/incremental_state_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,15 @@ impl IncrementalDbState {

self.state.insert(key.to_owned(), value.clone().into());
if let Err(e) = db.incremental_state_table().insert(key.to_owned(), value) {
soft_error!(
let _unused = soft_error!(
"insert_to_incremental_db",
buck2_error::buck2_error!(
buck2_error::ErrorTag::Tier0,
"Failed to insert {} into sqlite db. {}",
key, e
),
quiet: true
)
.unwrap();
);
};
}
None => {
Expand All @@ -95,16 +94,15 @@ impl IncrementalDbState {
{
// This should be converted into a real error later, marking as a soft error for now as the row not existing
// might show up as an error but doesn't actually matter in reality.
soft_error!(
let _unused = soft_error!(
"delete_from_incremental_db",
buck2_error::buck2_error!(
buck2_error::ErrorTag::Tier0,
"Failed to remove incremental path map from sqlite db. {}",
e
),
quiet: true
)
.unwrap();
);
}

self.state.remove(key);
Expand Down
Loading