Пример #1
0
 // There might be races between cancelling of the token and it's actual arriving to the target grain
 // as token on arriving causes installing of GCT extension, and without such extension the cancelling
 // attempt will result in GrainExtensionNotInstalledException exception which shows
 // existence of race condition, so just retry in that case.
 private Task CancelTokenWithRetries(Guid id, ICancellationSourcesExtension tokenExtension)
 {
     return(AsyncExecutorWithRetries.ExecuteWithRetries(
                i => tokenExtension.CancelRemoteToken(id),
                MaxNumCancelErrorTries,
                _cancelCallRetryExceptionFilter,
                _cancelCallMaxWaitTime,
                _cancelCallBackoffProvider));
 }
Пример #2
0
        private async Task CancelTokenWithRetries(
            Guid id,
            ConcurrentDictionary <GrainId, GrainReference> grainReferences,
            GrainId key,
            ICancellationSourcesExtension tokenExtension)
        {
            await AsyncExecutorWithRetries.ExecuteWithRetries(
                i => tokenExtension.CancelRemoteToken(id),
                MaxNumCancelErrorTries,
                _cancelCallRetryExceptionFilter,
                _cancelCallMaxWaitTime,
                _cancelCallBackoffProvider);

            grainReferences.TryRemove(key, out _);
        }