File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
tracer/src/Datadog.Trace/Configuration Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,9 @@ stages:
179179 - checkout : none
180180 - bash : |
181181 rm -rf ./s
182- git clone --quiet --no-checkout --depth 1 --branch master $BUILD_REPOSITORY_URI ./s
182+ git clone --quiet --no-checkout --depth 1 --branch hotfix/2.24.0 $BUILD_REPOSITORY_URI ./s
183183 cd s
184- MASTER_SHA=$(git rev-parse origin/master )
184+ MASTER_SHA=$(git rev-parse origin/hotfix/2.24.0 )
185185 rm -rf ./s
186186 echo "Using master commit ID $MASTER_SHA"
187187 echo "##vso[task.setvariable variable=master;isOutput=true]$MASTER_SHA"
@@ -4673,4 +4673,4 @@ stages:
46734673 -H "Content-Type: application/json" \
46744674 -d '{"commit": "'$sha'"}' \
46754675 $(slackWebhookUrl)
4676- displayName: "notify"
4676+ displayName: "notify"
Original file line number Diff line number Diff line change 55
66using System ;
77using System . Diagnostics . CodeAnalysis ;
8+ using System . Threading ;
89using Datadog . Trace . Logging ;
910using Datadog . Trace . Pdb ;
1011
@@ -16,6 +17,7 @@ internal class GitMetadataTagsProvider : IGitMetadataTagsProvider
1617{
1718 private readonly ImmutableTracerSettings _immutableTracerSettings ;
1819 private GitMetadata ? _cachedGitTags = null ;
20+ private int _tryCount = 0 ;
1921
2022 public GitMetadataTagsProvider ( ImmutableTracerSettings immutableTracerSettings )
2123 {
@@ -91,9 +93,20 @@ private bool TryGetGitTagsFromSourceLink([NotNullWhen(true)] out GitMetadata? re
9193 {
9294 // Cannot determine the entry assembly. This may mean this method was called too early.
9395 // Return false to indicate that we should try again later.
94- Log . Debug ( "Cannot extract SourceLink information as the entry assembly could not be determined." ) ;
95- result = default ;
96- return false ;
96+
97+ var nbTries = Interlocked . Increment ( ref _tryCount ) ;
98+ if ( nbTries > 100 )
99+ {
100+ Log . Debug ( "Tried 100 times to get the SourceLink information. Giving up." ) ;
101+ result = GitMetadata . Empty ;
102+ return true ;
103+ }
104+ else
105+ {
106+ Log . Debug ( "Cannot extract SourceLink information as the entry assembly could not be determined." ) ;
107+ result = default ;
108+ return false ;
109+ }
97110 }
98111
99112 if ( SourceLinkInformationExtractor . TryGetSourceLinkInfo ( assembly , out var commitSha , out var repositoryUrl ) )
You can’t perform that action at this time.
0 commit comments