Repository navigation
Fix UniqueIdGenerator seed collision in parallel pipelines - #8678
Merged
Merged
Conversation
Mix process ID into the seed to ensure different seeds for parallel processes started at the same microsecond. This prevents duplicate UniqueIds when multiple TOPP tools run simultaneously in a pipeline, which was causing "FeatureHandle exists twice in ConsensusMap" errors in QualityControl. The seed now combines: - Microsecond-resolution time (existing) - Process ID shifted to upper 32 bits (new) Added SysInfo::getProcessId() as a cross-platform wrapper for getpid(). Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
📝 WalkthroughWalkthroughAdded SysInfo::getProcessId() with platform-specific implementations and used it in UniqueIdGenerator::init_() to mix the process ID into the RNG seed via a left-shifted XOR. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/openms/include/OpenMS/SYSTEM/SysInfo.h`:
- Around line 45-48: The Doxygen comment for the new API does not use the
required `@brief` style; update the comment for SysInfo::getProcessId() to use the
`@brief` tag and a one-line summary followed by any additional tags (e.g.,
`@return`) as needed so it conforms to the project Doxygen guidelines; locate the
declaration of static Int64 getProcessId() in class SysInfo and replace the
current comment block with a `@brief` line plus the existing `@return` description.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
claude Bot
pushed a commit
that referenced
this pull request
Jan 18, 2026
Added 19 missing PRs to OpenMS 3.6.0 changelog: PyOpenMS: - #8530: Build system modernization with py-build-cmake - #8633: SpectrumNativeIDParser wrapper - #8655: Arrow/Parquet export with DataFrame methods (BREAKING: method renames) - #8661: Build dependency docs - #8664: Biosaur2Algorithm wrap-inherits - #8668: wrap-doc documentation - #8674: Docstring validation tests TOPP tools: - #8643: FileInfo FASTA stats - #8650: FileConverter MSP support - #8649: PeakPickerHiRes parameter OpenMS Library: - #8633: SpectrumNativeIDParser class - #8655: ArrowExport helper - #8651, #8656, #8659, #8660, #8662: Performance optimizations Fixes: - #8645: DataArray handling in filters - #8672: Test file correction - #8678: UniqueIdGenerator seed collision fix Build System: - #8675, #8676: Claude CI workflows Also reorganized misplaced entries from lines 122-129. Co-authored-by: Timo Sachsenberg <[email protected]>
timosachsenberg
added a commit
that referenced
this pull request
Jan 18, 2026
* Add comprehensive changelog for OpenMS 3.6.0 Includes changes from 96 merged PRs since version 3.5.0: - General: macOS Intel discontinued, Ubuntu 24.04, notarization in CI - Dependencies: Autowrap >= 0.26.0, Eigen minimum 3.4.0 - PyOpenMS: Pythonic methods (__len__, __str__, __repr__, __hash__), DataFrame support, new wrappers, string handling improvements - TOPP tools: MapAligner spectra transformation, FileInfo improvements, IsobaricWorkflow fixes, SageAdapter thread handling - OpenMS Library: PeakFileOptions, ParamIterator, SpectrumAnnotator - Breaking changes: Matrix<T> Eigen decoupling, API renames, FileWatcher move - Bug fixes: NucleicAcidSearchEngine, LogConfigHandler, decoy generation - Documentation: Targeted Quantitation, parameter annotations, AGENTS.md - Build: macOS notarization, Parquet support, pytest fixtures Co-Authored-By: Claude Opus 4.5 <[email protected]> * Add missing changelog entries for recently merged PRs Added 19 missing PRs to OpenMS 3.6.0 changelog: PyOpenMS: - #8530: Build system modernization with py-build-cmake - #8633: SpectrumNativeIDParser wrapper - #8655: Arrow/Parquet export with DataFrame methods (BREAKING: method renames) - #8661: Build dependency docs - #8664: Biosaur2Algorithm wrap-inherits - #8668: wrap-doc documentation - #8674: Docstring validation tests TOPP tools: - #8643: FileInfo FASTA stats - #8650: FileConverter MSP support - #8649: PeakPickerHiRes parameter OpenMS Library: - #8633: SpectrumNativeIDParser class - #8655: ArrowExport helper - #8651, #8656, #8659, #8660, #8662: Performance optimizations Fixes: - #8645: DataArray handling in filters - #8672: Test file correction - #8678: UniqueIdGenerator seed collision fix Build System: - #8675, #8676: Claude CI workflows Also reorganized misplaced entries from lines 122-129. Co-authored-by: Timo Sachsenberg <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Timo Sachsenberg <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UniqueIdGeneratorwhen multiple TOPP tools start simultaneouslySysInfo::getProcessId()as cross-platform wrapper for process ID retrievalProblem
When multiple TOPP tools run in parallel (e.g., in TOPPAS pipelines), they can initialize at the same microsecond, resulting in identical RNG seeds. This causes duplicate UniqueIds across different files, leading to errors like:
Solution
Mix the process ID into the seed using XOR with a 32-bit shift:
This ensures parallel processes get different seeds even when started at the exact same microsecond.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.