Repository navigation
Sync back from odpi main 06038b2d (#121, #122) - #1117
Merged
Merged
Conversation
pack() admitted sections breadth-first in spec order. An optional section
declared ahead of a required one could therefore spend the budget the
required one needed, and the compile failed with "required section ...
does not fit" even though the required section fitted on its own. That
contradicts Section.required ("never dropped; the compile fails only if it
cannot fit even at its coarsest allowed rung") and the role docstring
("a packer drops evidence before instructions"), and made whether a valid
spec compiled depend on declaration order.
Admission now runs in two tiers: required sections first, then optional
ones, each tier in spec order. A symmetric group with any required member
is admitted in the required tier, because group members are admitted
together. Only the admission order changes: the packed sections and the
manifest stay in spec order, and the upgrade pass is untouched. Specs that
already declare their required sections first (Resource Explorer's
context_compile.py) pack exactly as before.
Tests: a new TestRequiredFirst class covers a required section declared
after an optional one, a required group declared after an optional
section (both raised BudgetError before this change), and that output
order still follows the spec.
Fixes #119
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
With backend="redis", any Redis error from get() or set() reached the caller. A Redis outage therefore failed every cached request path (for example Resource Explorer's RAG queries, which consult the cache first) with redis.exceptions.ConnectionError, instead of running them uncached. The class already holds that "a cache that cannot store something must still not break the operation it was speeding up", but applied it only to values that aren't JSON-serializable. Now: - get() treats a RedisError as a miss (counted in the stats) and logs a warning; - set() treats a RedisError as "not cached" and logs a warning; - invalidate_scope() and clear() still raise. They are explicit maintenance calls, and reporting an invalidation that never reached Redis as done would leave stale answers to be served once Redis is back. The exception class is captured in _connect_redis, so the redis package is still imported only when Redis is configured. Only RedisError is absorbed; any other exception still propagates. Writes also register the key in its scope set before storing the value. Previously the value went first, so a failure between the two commands left an entry its scope did not list, which invalidate_scope() could never remove. In the new order the same failure leaves only a set member with no entry, which is harmless. Tests: the Redis backend had no coverage. A small in-memory stand-in for the redis module (installed through sys.modules, so neither a server nor the optional extra is needed) now covers round-trips, scope invalidation, unserializable values, reads and writes during an outage, recovery, logging, invalidation still raising, non-Redis errors still raising, and the partial-write case. The README's design notes describe the outage behaviour. Fixes #120 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
… before optional ones in pack() Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…Redis as a cache miss Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…nto the odpi sync Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
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.
Sync back from odpi/egeria-trellis main (06038b2)
This brings fork main up to odpi main after odpi#126. It is a fast-forward: fork main 6b80583 is an ancestor of odpi main 06038b2. After it merges, the fork and odpi hold the same code.
What it adds to fork main:
pack()admits required sections before optional ones.No new code beyond those two external contributions. They were checked before #126 merged:
Please merge it with a merge commit or a fast-forward, not a squash, so fork main keeps odpi's history.
🤖 Generated with Claude Code