Skip to content

Commit

Permalink
fix: Fix a segfault when using sendDataOnExit with Linux on Docker. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaffinito authored Nov 2, 2023
1 parent 4b75587 commit 3ac75a0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Agent/NewRelic/Agent/Core/AgentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ private void Shutdown(bool cleanShutdown)

if (cleanShutdown)
{
Log.Debug("Agent is connected, executing a clean shutdown.");
EventBus<PreCleanShutdownEvent>.Publish(new PreCleanShutdownEvent());
EventBus<CleanShutdownEvent>.Publish(new CleanShutdownEvent());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Agent/Core/Samplers/AbstractSampler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected virtual bool Enabled
{
get
{
return !_configuration.DisableSamplers;
return !_configuration.DisableSamplers && !Agent.IsAgentShuttingDown;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Agent/Core/Time/Scheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void ExecuteEvery(Action action, TimeSpan timeBetweenExecutions, TimeSpan
var existingTimer = _recurringTimers.GetValueOrDefault(action);
if (existingTimer != null)
{
Log.Debug("Stopping existing timer for scheduled action");
Log.Debug("Stopping existing timer for scheduled action for " + action.Method.DeclaringType.FullName + "." + action.Method.Name);
existingTimer.Dispose();
}

Expand Down
1 change: 1 addition & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'FullAgent.sln'))\build\StyleCop.props" />
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NuGetAudit>false</NuGetAudit>
</PropertyGroup>
</Project>

0 comments on commit 3ac75a0

Please sign in to comment.