Исправление гонки при параллельном чтении системного перечисления (#1734) - #1736
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change replaces unsynchronized deprecation tracking with ChangesEnumeration concurrency
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The concurrent enumeration-read path now uses thread-safe deprecation tracking, with added parallel-access coverage. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Andrei Ovsiankin <EvilBeaver@users.noreply.github.com>
|

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (0.00% Estimated after merge)
Проблема
При первом одновременном обращении из фоновых заданий к значению системного перечисления (например,
НаправлениеПоиска.СКонца) возникалSystem.IndexOutOfRangeExceptionвнутриHashSet.Add.Причина:
EnumerationContext.WarnDeprecation()помечал уже проверенные свойства в общемHashSet<int>без синхронизации.HashSet<T>не поддерживает конкурентную запись.Fixes #1734
Решение
Набор проверенных свойств заменён на
ConcurrentDictionary<int, byte>. Первое обращение к свойству атомарно фиксируется черезTryAdd, повторные чтения не гоняются за общим изменяемымHashSet.Поведение предупреждений об устаревших значениях не меняется: сообщение по-прежнему пишется один раз.
Тесты
НаправлениеПоиска.СКонцаSummary by CodeRabbit
Bug Fixes
Tests