Repository navigation
fix(daemon): a registry entry that does not read is not written over with only its claims - #592
Merged
Merged
Conversation
…with only its claims
`read_raw` turned an entry that stayed cut off after its retries, or JSON
that is no object, into "no entry"; `change()` then wrote back only the
fields it sets (`{claims}` from `set_claims_in`, the shift from
`set_shift_in`), so the entry lost its id and name, dropped out of
`list()`, and its port claims no longer counted against another stack's
lanes (#535).
`read_raw` now returns an error for such an entry (`InvalidData` when it
reads and does not parse) and says it in the log, the "no object" case
too. `change()` passes it on, except for a registration: it names the
whole stack (id, name, file, repository), as a daemon's start does, and
may write the entry anew.
Closes #570
Bug-Class: unreadable-read-as-absent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… its claims With the previous commit, an entry that stopped parsing while its daemon ran stayed so: `follow_claims` failed every 5 s, logged `claims_not_written` each time, and the claims stayed unseen by other stacks until the next start. The daemon holds the whole entry, its shift too: `set_claims` now takes it, registers it anew on `InvalidData`, puts the shift back, and writes the claims. Code review before 0.51.0, finding 5. Bug-Class: unreadable-read-as-absent Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Code review before 0.51.0, finding 5: an entry that stops parsing while its daemon runs no longer stays so. |
This was referenced Nov 19, 2026
Merged
Merged
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.
What and why
read_rawincrates/devstack-daemon/src/registry.rstook an entry that stayed cut off after its retries, or JSON that is no object, for no entry.change()then wrote back only what the caller sets: the daemon's claims (set_claims_in) or a shift (set_shift_in). The entry lost its id and name, dropped out oflist(), and its port claims no longer counted against another stack's lanes (#535).read_rawreturns an error for such an entry (InvalidDatawhen it reads and does not parse), and says it in the log once, the "no object" case too (the comment promised that, the code did not).change()passes the error on. Only a registration (register, which a daemon's start and the hub's "add stack" do) names the whole stack and may write an unparsable entry anew, so a broken file heals at the next start instead of blocking the stack for good.No review card: no trust, concept, contract or term changes; the registry's file format is unchanged.
Bug fix
unreadable-read-as-absenta_write_of_some_fields_keeps_an_entry_that_does_not_read, red before the fix atset_claims_in(...).is_err()(truncated entry), green after; daemon unit tests 230/230. Not reproduced in a running stack (found in a review; a truncated entry needs a broken file).Decided on my own
devstack up --shifton such an entry now fails with "could not keep the shift in the registry of stacks: …" instead of writing a shift-only entry.Closes #570
🤖 Generated with Claude Code