File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright (c) Microsoft Corporation.
2
2
// Licensed under the MIT License.
3
3
4
+ using Agent . Sdk . Knob ;
4
5
using System ;
5
6
using System . Collections . Generic ;
6
7
using System . Threading ;
@@ -18,8 +19,7 @@ public class BuildServer
18
19
19
20
public BuildServer ( VssConnection connection )
20
21
{
21
- connection . Settings . SendTimeout = TimeSpan . FromSeconds ( 300 ) ;
22
- ArgUtil . NotNull ( connection , nameof ( connection ) ) ;
22
+ connection . Settings . SendTimeout = TimeSpan . FromSeconds ( AgentKnobs . ArtifactAssociateTimeout . GetValue ( UtilKnobValueContext . Instance ( ) ) . AsInt ( ) ) ;
23
23
_buildHttpClient = connection . GetClient < BuildHttpClient > ( ) ;
24
24
}
25
25
Original file line number Diff line number Diff line change @@ -779,5 +779,12 @@ public class AgentKnobs
779
779
"If true, agent will use sparse checkout in checkout task." ,
780
780
new RuntimeKnobSource ( "AGENT_USE_SPARSE_CHECKOUT_IN_CHECKOUT_TASK" ) ,
781
781
new BuiltInDefaultKnobSource ( "false" ) ) ;
782
+
783
+ // Artifact associate timeout for pipeline artifact.
784
+ public static readonly Knob ArtifactAssociateTimeout = new Knob (
785
+ nameof ( ArtifactAssociateTimeout ) ,
786
+ "Timeout for channel communication between agent listener and worker processes." ,
787
+ new EnvironmentKnobSource ( "PIPELINE_ARTIFACT_ASSOCIATE_TIMEOUT" ) ,
788
+ new BuiltInDefaultKnobSource ( "900" ) ) ; // 15 * 60 - Setting the timeout to 15 minutes to account for slowness from azure storage and retries.
782
789
}
783
790
}
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public async Task ConnectAsync(VssConnection jobConnection)
57
57
}
58
58
catch ( Exception ex ) when ( attemptCount > 0 )
59
59
{
60
- Trace . Info ( $ "Catch exception during connect. { attemptCount } attemp left.") ;
60
+ Trace . Info ( $ "Catch exception during connect. { attemptCount } attempt(s) left.") ;
61
61
Trace . Error ( ex ) ;
62
62
}
63
63
You can’t perform that action at this time.
0 commit comments