fix: harden queue recovery semantics#2
Open
mikehostetler wants to merge 5 commits into
Open
Conversation
|
|
||
| # Initialize the directory and cache the keyspace before starting supervisor | ||
| {:ok, root} = Internal.init_root(config.repo, job_queue_module) | ||
| root = Keyword.get_lazy(opts, :root, fn -> init_root!(config.repo, job_queue_module) end) |
Collaborator
There was a problem hiding this comment.
blocking: If callers pass a precomputed root, the consumer starts against that root, but the public JobQueue.enqueue/4 path still resolves its root via Internal.root_keyspace/1. Because this path skips Internal.init_root/2, nothing writes the supplied root into :persistent_term, so enqueue can fall back to Keyspace.new("job_queue/<module>/") while the consumer scans the supplied root. Either cache the provided root here or make the public enqueue/stats path read the same configured root.
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
Stacked on #1. This branch is based on
intent-ledger/action-hooks; review after or with #1. GitHub could not use #1 as the upstream base because that branch only exists on the fork, and I do not have permission to create the base branch inbedrock-kv/job_queue.Tests
mix test