Skip to content

Commit 3ac75a0

Browse files
authored
fix: Fix a segfault when using sendDataOnExit with Linux on Docker. (#2018)
1 parent 4b75587 commit 3ac75a0

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

src/Agent/NewRelic/Agent/Core/AgentManager.cs

+1
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ private void Shutdown(bool cleanShutdown)
370370

371371
if (cleanShutdown)
372372
{
373+
Log.Debug("Agent is connected, executing a clean shutdown.");
373374
EventBus<PreCleanShutdownEvent>.Publish(new PreCleanShutdownEvent());
374375
EventBus<CleanShutdownEvent>.Publish(new CleanShutdownEvent());
375376
}

src/Agent/NewRelic/Agent/Core/Samplers/AbstractSampler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ protected virtual bool Enabled
1818
{
1919
get
2020
{
21-
return !_configuration.DisableSamplers;
21+
return !_configuration.DisableSamplers && !Agent.IsAgentShuttingDown;
2222
}
2323
}
2424

src/Agent/NewRelic/Agent/Core/Time/Scheduler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void ExecuteEvery(Action action, TimeSpan timeBetweenExecutions, TimeSpan
7070
var existingTimer = _recurringTimers.GetValueOrDefault(action);
7171
if (existingTimer != null)
7272
{
73-
Log.Debug("Stopping existing timer for scheduled action");
73+
Log.Debug("Stopping existing timer for scheduled action for " + action.Method.DeclaringType.FullName + "." + action.Method.Name);
7474
existingTimer.Dispose();
7575
}
7676

tests/Directory.Build.props

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'FullAgent.sln'))\build\StyleCop.props" />
55
<PropertyGroup>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7+
<NuGetAudit>false</NuGetAudit>
78
</PropertyGroup>
89
</Project>

0 commit comments

Comments
 (0)