@@ -14,7 +14,7 @@ public class AdaptiveUploadController : IAdaptiveUploadController
1414 private const int MAX_CHUNK_SIZE_BYTES = 16 * 1024 * 1024 ; // 16 MB
1515 private const int MIN_PARALLELISM = 2 ;
1616 private const int MAX_PARALLELISM = 4 ;
17- private const int CLIENT_TIMEOUTS_BEFORE_DOWNSCALE = 2 ;
17+ private const int CLIENT_NETWORK_ISSUES_BEFORE_DOWNSCALE = 2 ;
1818
1919 private const double MULTIPLIER_2_X = 2.0 ;
2020 private const double MULTIPLIER_1_75_X = 1.75 ;
@@ -37,7 +37,7 @@ public class AdaptiveUploadController : IAdaptiveUploadController
3737 private readonly Queue < long > _recentBytes ;
3838 private int _successesInWindow ;
3939 private int _windowSize ;
40- private int _consecutiveClientTimeouts ;
40+ private int _consecutiveClientNetworkIssues ;
4141 private readonly ILogger < AdaptiveUploadController > _logger ;
4242 private readonly object _syncRoot = new ( ) ;
4343
@@ -90,7 +90,7 @@ public void RecordUploadResult(UploadResult uploadResult)
9090 {
9191 if ( uploadResult . FailureKind == UploadFailureKind . ClientCancellation )
9292 {
93- _consecutiveClientTimeouts = 0 ;
93+ _consecutiveClientNetworkIssues = 0 ;
9494 return ;
9595 }
9696
@@ -100,7 +100,7 @@ public void RecordUploadResult(UploadResult uploadResult)
100100 return ;
101101 }
102102
103- _consecutiveClientTimeouts = 0 ;
103+ _consecutiveClientNetworkIssues = 0 ;
104104
105105 EnqueueSample ( uploadResult . Elapsed , uploadResult . IsSuccess , uploadResult . ActualBytes ) ;
106106
@@ -164,24 +164,24 @@ private void EnqueueSample(TimeSpan elapsed, bool isSuccess, long actualBytes)
164164
165165 private void HandleClientNetworkIssue ( string ? fileId , UploadFailureKind failureKind )
166166 {
167- _consecutiveClientTimeouts += 1 ;
168- if ( _consecutiveClientTimeouts < CLIENT_TIMEOUTS_BEFORE_DOWNSCALE )
167+ _consecutiveClientNetworkIssues += 1 ;
168+ if ( _consecutiveClientNetworkIssues < CLIENT_NETWORK_ISSUES_BEFORE_DOWNSCALE )
169169 {
170170 _logger . LogDebug (
171- "Adaptive: file {FileId} client network issue {FailureKind} {TimeoutCount }/{Threshold}. Waiting before downscale" ,
171+ "Adaptive: file {FileId} client network issue {FailureKind} {IssueCount }/{Threshold}. Waiting before downscale" ,
172172 fileId ?? "-" ,
173173 failureKind ,
174- _consecutiveClientTimeouts ,
175- CLIENT_TIMEOUTS_BEFORE_DOWNSCALE ) ;
174+ _consecutiveClientNetworkIssues ,
175+ CLIENT_NETWORK_ISSUES_BEFORE_DOWNSCALE ) ;
176176
177177 return ;
178178 }
179179
180180 _logger . LogInformation (
181- "Adaptive: file {FileId} client network issue threshold reached ({TimeoutCount }). Downscaling upload settings" ,
181+ "Adaptive: file {FileId} client network issue threshold reached ({IssueCount }). Downscaling upload settings" ,
182182 fileId ?? "-" ,
183- _consecutiveClientTimeouts ) ;
184- _consecutiveClientTimeouts = 0 ;
183+ _consecutiveClientNetworkIssues ) ;
184+ _consecutiveClientNetworkIssues = 0 ;
185185 Downscale ( fileId , "client network issues" ) ;
186186 }
187187
@@ -396,7 +396,7 @@ private void ResetState()
396396 _currentChunkSizeBytes = Math . Clamp ( INITIAL_CHUNK_SIZE_BYTES , MIN_CHUNK_SIZE_BYTES , MAX_CHUNK_SIZE_BYTES ) ;
397397 _currentParallelism = MIN_PARALLELISM ;
398398 _windowSize = _currentParallelism ;
399- _consecutiveClientTimeouts = 0 ;
399+ _consecutiveClientNetworkIssues = 0 ;
400400 }
401401
402402 ResetWindow ( ) ;
0 commit comments