-
Notifications
You must be signed in to change notification settings - Fork 117
feat(upload): Add global config default logging #6019
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
Changes from all commits
984c113
60a4b3b
80e018e
4f82fcd
d07ae7c
55b6615
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,12 @@ fn is_err_or_empty(filters_config: &ErrorBoundary<GenericFiltersConfig>) -> bool | |
| } | ||
| } | ||
|
|
||
| // Temporary until we understand why we see false killswitch values sometimes appearing. | ||
| fn default_killswitched() -> bool { | ||
| relay_log::info!("using default for endpoint fetch config"); | ||
| bool::default() | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debug log fires on normal deserialization, not just errorsLow Severity The Reviewed by Cursor Bugbot for commit 80e018e. Configure here. |
||
|
|
||
| /// All options passed down from Sentry to Relay. | ||
| #[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)] | ||
| #[serde(default)] | ||
|
|
@@ -172,6 +178,7 @@ pub struct Options { | |
|
|
||
| /// Kill-switch for fetching project configs in endpoints. | ||
| #[serde( | ||
| default = "default_killswitched", | ||
| rename = "relay.endpoint-fetch-config.enabled", | ||
| deserialize_with = "default_on_error", | ||
| skip_serializing_if = "is_default" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,11 +168,11 @@ impl GlobalConfigHandle { | |
| /// Returns the currently loaded or a default global config. | ||
| /// | ||
| /// When no global config has been received from upstream yet, | ||
| /// this will return a default global config. | ||
| pub fn current(&self) -> Arc<GlobalConfig> { | ||
| /// this will return None. | ||
| pub fn current(&self) -> Option<Arc<GlobalConfig>> { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking of adding an additional method. The intention of the global config was always, even if it's missing the defaults should be good enough for Relay to work. For example proxy mode Relays will not have a global config. But looking at the few places we actually use |
||
| match &*self.watch.borrow() { | ||
| Status::Ready(config) => Arc::clone(config), | ||
| Status::Pending => Default::default(), | ||
| Status::Ready(config) => Some(Arc::clone(config)), | ||
| Status::Pending => None, | ||
| } | ||
| } | ||
| } | ||
|
|
||


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.
Bug: The
default_killswitchedfunction logs a message on every config deserialization (every 10s) when a field is absent, causing a log flood.Severity: MEDIUM
Suggested Fix
Remove the
info!log statement from thedefault_killswitchedfunction. Functions used byserdeto provide default values should be free of side effects like logging to prevent unintended behavior during frequent deserialization.Prompt for AI Agent