-
Notifications
You must be signed in to change notification settings - Fork 6
feat(csharp): integrate straggler mitigation into CloudFetchDownloader #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stack/straggler-detector
Are you sure you want to change the base?
feat(csharp): integrate straggler mitigation into CloudFetchDownloader #42
Conversation
CloudFetchDownloader Integration: - Background monitoring thread runs every 5 seconds - Per-file CancellationTokenSource for clean cancellation - Automatic retry mechanism for cancelled stragglers - Metrics tracking for all active downloads - Sequential fallback mode support - Thread-safe metrics and cancellation token management Implementation only - tests in next PR. Builds on: stack/straggler-detector
| // Straggler mitigation fields | ||
| private readonly bool _isStragglerMitigationEnabled; | ||
| private readonly StragglerDownloadDetector? _stragglerDetector; | ||
| private readonly ConcurrentDictionary<long, FileDownloadMetrics>? _activeDownloadMetrics; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should make these part of the detector for better class isolation design. and use event notificaiton to the download detector for reporting
| var config = stragglerConfig ?? CloudFetchStragglerMitigationConfig.Disabled; | ||
| _isStragglerMitigationEnabled = config.Enabled; | ||
|
|
||
| if (config.Enabled) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, this logic should in the detector and if not enabled, the detector should just return nothing
|
|
||
| _cancellationTokenSource?.Cancel(); | ||
|
|
||
| // Stop straggler monitoring if running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this to the straggler detector?
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall feedback on this file, the change in this file should be minimal, it should just get a download failure with a reason of straggler download detection and retry. rest of the logic should be handled by the straggler download detector
🥞 Stacked PR
Use this link to review incremental changes.
Summary
Integrates straggler mitigation components into
CloudFetchDownloader. Implementation only - tests in next PR.CloudFetchDownloader Integration:
CancellationTokenSourcefor clean cancellation of individual downloadsFileDownloadMetricsConcurrentDictionaryand atomic operationsKey Implementation Details:
FetchResultscallCode Changes:
_stragglerMitigationConfigfieldStragglerDownloadDetectorwhen enabled_activeDownloadMetricsdictionary for tracking_perFileCancellationTokensfor individual cancellation_isSequentialModeflag and counterMonitorForStragglers()background threadDownloadFileAsync()to track metrics and respect per-file CTSDispose()