Compare producer stop markers by identity - #377
Merged
grosser merged 3 commits intoAug 28, 2026
Conversation
grosser
approved these changes
Aug 28, 2026
grosser
left a comment
Owner
There was a problem hiding this comment.
a bit far-fetched but technically correct 👍
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
Recognize only the Parallel::Stop object as the producer terminator.
Reproduction and verification
A producer yielding an ordinary object whose
==method returns true currently stops without processing it. Stop is a unique sentinel, so its identity must be compared rather than delegating equality to the item.A finite producer fixture with custom equality fails before and passes after. Fifteen existing producer/queue examples pass.
The combined installed-release candidate passes 800 model checks across direct, thread, process and Ractor modes. Existing selected suite: 165 examples, zero failures, nine pending, baseline and candidate on rbenv Ruby 4.0.6. Global process-name kill tests and the 200-process stress example were excluded for shared-host safety. SQLite examples use temporary databases. An external verification bundle uses already-installed dependencies; upstream Gemfile/lockfile/tests remain unchanged.
Runtime RuboCop passes. Full upstream RuboCop reports the same pre-existing RSpec/MatchWithSimpleRegex offense in spec/parallel_spec.rb:278 on both versions; no full green-lint claim. Gem packaging retains 2.1.0, Ruby >= 3.3, all four published paths and metadata, with no dependency changes.
Compatibility and limitations
Items merely no longer impersonate Stop via custom equality. Returning Parallel::Stop still terminates production; no producer scheduling change.
No tests were added or modified under the consuming repository's no-new-tests policy. Reproductions/model checks are external scratch scripts. No production operations or claim of complete concurrency/platform coverage.