{"record":{"id":"adcb05a47db1bb8b","repo":"dotnet/orleans","slug":"metadataonlyconflictmaxbackoff-must-be-non-negativ-adcb05","errorCode":null,"errorMessage":"MetadataOnlyConflictMaxBackoff must be non-negative.","messagePattern":"MetadataOnlyConflictMaxBackoff must be non-negative\\.","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorage.cs","lineNumber":1290,"sourceCode":"\n            if (Options.CompactionSizeThreshold <= 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(options), $\"{nameof(AzureTableJournalStorageOptions.CompactionSizeThreshold)} must be positive.\");\n            }\n\n            if (Options.MaxMetadataOnlyConflictRetries < 0)\n            {\n                throw new ArgumentOutOfRangeException(nameof(options), $\"{nameof(AzureTableJournalStorageOptions.MaxMetadataOnlyConflictRetries)} must be non-negative.\");\n            }\n\n            if (Options.MetadataOnlyConflictInitialBackoff < TimeSpan.Zero)\n            {\n                throw new ArgumentOutOfRangeException(nameof(options), $\"{nameof(AzureTableJournalStorageOptions.MetadataOnlyConflictInitialBackoff)} must be non-negative.\");\n            }\n\n            if (Options.MetadataOnlyConflictMaxBackoff < TimeSpan.Zero)\n            {\n                throw new ArgumentOutOfRangeException(nameof(options), $\"{nameof(AzureTableJournalStorageOptions.MetadataOnlyConflictMaxBackoff)} must be non-negative.\");\n            }\n\n            JournalFormatKey = journalFormatKey;\n            TableClientProvider = tableClientProvider;\n            Instruments = instruments;\n        }\n\n        public ILogger<AzureTableJournalStorage> Logger { get; }\n\n        public AzureTableJournalStorageOptions Options { get; }\n\n        public string? JournalFormatKey { get; }\n\n        public TableClientProvider TableClientProvider { get; }\n\n        public AzureTableJournalStorageInstruments Instruments { get; }\n    }\n","sourceCodeStart":1272,"sourceCodeEnd":1308,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorage.cs#L1272-L1308","documentation":"AzureTableJournalStorageOptions.MetadataOnlyConflictMaxBackoff was set to a negative TimeSpan. The constructor (AzureTableJournalStorage.cs:1288) requires it non-negative (TimeSpan.Zero is allowed). This caps the exponential backoff used between metadata-only conflict retries. The argument blamed is `options`.","triggerScenarios":"Configuring MetadataOnlyConflictMaxBackoff < TimeSpan.Zero; thrown at AzureTableJournalStorage.cs:1290.","commonSituations":"Negative TimeSpan from config binding; arithmetic that produced a negative cap; mistaking the cap for a duration to subtract.","solutions":["Set MetadataOnlyConflictMaxBackoff to TimeSpan.Zero or a positive value (default 200 ms).","Ensure the value is >= MetadataOnlyConflictInitialBackoff in practice to get a sensible schedule.","Validate via IValidateOptions<T> at startup."],"exampleFix":"// before\noptions.MetadataOnlyConflictMaxBackoff = TimeSpan.FromMilliseconds(-1);\n\n// after\noptions.MetadataOnlyConflictMaxBackoff = AzureTableJournalStorageOptions.DEFAULT_METADATA_ONLY_CONFLICT_MAX_BACKOFF;","handlingStrategy":"validation","validationCode":"if (options.MetadataOnlyConflictMaxBackoff < TimeSpan.Zero)\n    throw new ArgumentOutOfRangeException(nameof(options.MetadataOnlyConflictMaxBackoff), \"Must be non-negative\");","typeGuard":"static bool IsValidMaxBackoff(TimeSpan v) => v >= TimeSpan.Zero;","tryCatchPattern":null,"preventionTips":["Keep max backoff >= initial backoff for a sensible schedule.","Use TimeSpan.Zero only if immediate retry is intended.","Validate via IValidateOptions<T>."],"tags":["configuration","options","validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}