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 11// Copyright (c) Microsoft Corporation.
22// Licensed under the MIT License.
33
4+ using Agent . Sdk . Knob ;
45using System ;
56using System . Collections . Generic ;
67using System . Threading ;
@@ -18,8 +19,7 @@ public class BuildServer
1819
1920 public BuildServer ( VssConnection connection )
2021 {
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 ( ) ) ;
2323 _buildHttpClient = connection . GetClient < BuildHttpClient > ( ) ;
2424 }
2525
Original file line number Diff line number Diff line change @@ -779,5 +779,12 @@ public class AgentKnobs
779779 "If true, agent will use sparse checkout in checkout task." ,
780780 new RuntimeKnobSource ( "AGENT_USE_SPARSE_CHECKOUT_IN_CHECKOUT_TASK" ) ,
781781 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.
782789 }
783790}
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public async Task ConnectAsync(VssConnection jobConnection)
5757 }
5858 catch ( Exception ex ) when ( attemptCount > 0 )
5959 {
60- Trace . Info ( $ "Catch exception during connect. { attemptCount } attemp left.") ;
60+ Trace . Info ( $ "Catch exception during connect. { attemptCount } attempt(s) left.") ;
6161 Trace . Error ( ex ) ;
6262 }
6363
You can’t perform that action at this time.
0 commit comments