newrelic / go-agent

New Relic Go Agent
Apache License 2.0
764 stars 294 forks source link

added checks for the presence of the security agent before calling se… #756

Closed nr-swilloughby closed 1 year ago

nr-swilloughby commented 1 year ago

Since the fix to the race condition mentioned in PR 754 needs to lock and unlock a Transaction mutex each time a segment is created, this PR adds a check first so that if there is no security agent installed at all, we don't attempt the security call at all, removing the race condition and mutex overhead in that case. If a security agent is installed, then the mutex-protected code will be used to prevent the race condition.

codecov-commenter commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@99f46e0). Click here to learn what that means. The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop     #756   +/-   ##
==========================================
  Coverage           ?   82.33%           
==========================================
  Files              ?      136           
  Lines              ?    12187           
  Branches           ?        0           
==========================================
  Hits               ?    10034           
  Misses             ?     1893           
  Partials           ?      260           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more