♻️ Broker: polymorphic process revival#7361
Draft
GeigerJ2 wants to merge 1 commit into
Draft
Conversation
Broker.revive_process: hoist from CLI to ABCBroker: polymorphic process revival
43959e8 to
3c559e6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7361 +/- ##
==========================================
- Coverage 80.27% 80.27% -0.00%
==========================================
Files 577 577
Lines 45520 45521 +1
==========================================
Hits 36537 36537
- Misses 8983 8984 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
`verdi process repair` previously branched on `isinstance(broker, ZmqBroker)` to choose between writing tasks directly to the PersistentQueue (ZMQ) and calling a `RemoteProcessThreadController` (RabbitMQ). Move both paths behind a polymorphic `Broker.revive_process(pid)` method so the CLI is broker-agnostic and third-party brokers can plug in their own strategy. The default raises `NotImplementedError` rather than being abstract, so existing out-of-tree `Broker` subclasses remain instantiable; they opt in by overriding. Cache the `PersistentQueue` instance on `ZmqBroker` via `cached_property` so crash recovery runs once and the in-memory pending deque stays consistent across `iterate_tasks` and `revive_process`. Add tests covering the revive shape, multiple PIDs, the revive-then-iterate round trip, and the RabbitMQ delegation.
3c559e6 to
daafeab
Compare
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.
Copy of commit msg here: