Skip to content

Commit 36d5027

Browse files
committed
PR feedback
- Ensure subscribing doesn't receive out-of-order updates - Fix log message
1 parent fc7488a commit 36d5027

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tracer/src/Datadog.Trace/Configuration/DynamicConfigurationManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static void OnConfigurationChanged(IConfigurationSource dynamicConfig, T
8282
var wasUpdated = tracerSettings.Manager.UpdateSettings(dynamicConfig, manualConfig, TelemetryFactory.Config);
8383
if (wasUpdated)
8484
{
85-
Log.Information("Setting updates made via configuration in code were applied");
85+
Log.Information("Setting updates made via dynamic configuration were applied");
8686
}
8787

8888
// TODO: This might not record the config in the correct order in future, but would require

tracer/src/Datadog.Trace/Configuration/SettingsManager.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ public IDisposable SubscribeToChanges(Action<SettingChanges> callback)
5353
lock (_subscribers)
5454
{
5555
_subscribers.Add(subscription);
56-
}
5756

58-
if (Volatile.Read(ref _latest) is { } currentConfig)
59-
{
60-
try
57+
if (Volatile.Read(ref _latest) is { } currentConfig)
6158
{
62-
// If we already have updates, call this immediately
63-
callback(currentConfig);
64-
}
65-
catch (Exception ex)
66-
{
67-
Log.Error(ex, "Error notifying subscriber of updated MutableSettings during subscribe");
59+
try
60+
{
61+
// If we already have updates, call this immediately
62+
callback(currentConfig);
63+
}
64+
catch (Exception ex)
65+
{
66+
Log.Error(ex, "Error notifying subscriber of updated MutableSettings during subscribe");
67+
}
6868
}
6969
}
7070

0 commit comments

Comments
 (0)