@@ -155,7 +155,7 @@ internal RetryInfo(DateTime firstTimeOfFailureInUtc, TimeSpan? backoff = null)
155
155
private readonly TimeSpan _maxExtensionDuration ; // Maximum duration for which a message lease will be extended.
156
156
private readonly int _maxAckExtendQueueSize ; // Soft limit on push queue sizes. Used to throttle pulls.
157
157
private readonly int _maxAckExtendSendCount ; // Maximum number of ids to include in an ack/nack/extend push RPC.
158
- private readonly int _maxConcurrentPush ; // Mamimum number (slightly soft) of concurrent ack/nack/extend push RPCs.
158
+ private readonly int _maxConcurrentPush ; // Maximum number (slightly soft) of concurrent ack/nack/extend push RPCs.
159
159
160
160
private readonly Flow _flow ;
161
161
private readonly bool _useLegacyFlowControl ;
@@ -178,9 +178,10 @@ internal RetryInfo(DateTime firstTimeOfFailureInUtc, TimeSpan? backoff = null)
178
178
private bool _messageOrderingEnabled = false ; // True if subscription has ordering enabled, else false.
179
179
private readonly RetryState _retryState ;
180
180
private readonly ILogger _logger ;
181
+ private readonly int _clientIndex ; // The index of this client within the overall SubscriberClient, in the range 1-ClientCount. Only used for logging.
181
182
182
183
internal SingleChannel ( SubscriberClientImpl subscriber ,
183
- SubscriberServiceApiClient client , SubscriptionHandler handler ,
184
+ SubscriberServiceApiClient client , int clientIndex , SubscriptionHandler handler ,
184
185
Flow flow , bool useLegacyFlowControl ,
185
186
Action < Task > registerTaskFn ,
186
187
IClock clock )
@@ -190,6 +191,7 @@ internal SingleChannel(SubscriberClientImpl subscriber,
190
191
_scheduler = subscriber . _scheduler ;
191
192
_clock = subscriber . _clock ;
192
193
_client = client ;
194
+ _clientIndex = clientIndex ;
193
195
_handler = handler ;
194
196
_hardStopCts = subscriber . _globalHardStopCts ;
195
197
_pushStopCts = CancellationTokenSource . CreateLinkedTokenSource ( _hardStopCts . Token ) ;
@@ -303,7 +305,7 @@ private void StartStreamingPull()
303
305
if ( _retryState . Backoff is TimeSpan backoff )
304
306
{
305
307
// Delay, then start the streaming-pull.
306
- _logger ? . LogDebug ( "Delaying for {seconds}s before streaming pull call." , ( int ) backoff . TotalSeconds ) ;
308
+ _logger ? . LogDebug ( "Client {index} delaying for {seconds}s before streaming pull call." , _clientIndex , ( int ) backoff . TotalSeconds ) ;
307
309
Task delayTask = _scheduler . Delay ( backoff , _softStopCts . Token ) ;
308
310
Add ( delayTask , Next ( true , HandleStartStreamingPullWithoutBackoff ) ) ;
309
311
}
@@ -353,7 +355,7 @@ private void RestartPullOrThrow(Exception e)
353
355
/// </summary>
354
356
private void RestartPullAfterRetriableFailure ( Exception e )
355
357
{
356
- _logger ? . LogWarning ( e , "Recoverable error in streaming pull; will retry." ) ;
358
+ _logger ? . LogDebug ( e , "Recoverable error in streaming pull for client {index} ; will retry." , _clientIndex ) ;
357
359
// Update the retry state, increasing the backoff etc.
358
360
_retryState . OnFailure ( e ) ;
359
361
StopStreamingPull ( ) ;
0 commit comments