Skip to content

fix: report evicted handles as "evicted", not "not found" (#532) - #543

Open
Shashankss1205 wants to merge 1 commit into
mainfrom
fix/532-eviction-tombstones
Open

fix: report evicted handles as "evicted", not "not found" (#532)#543
Shashankss1205 wants to merge 1 commit into
mainfrom
fix/532-eviction-tombstones

Conversation

@Shashankss1205

Copy link
Copy Markdown
Collaborator

Fixes #532.

Problem

Both handle stores silently bulk-evict the oldest entries at their cap (estimator store: 10 oldest via HandleManager._cleanup_oldest; data store: oldest ~20% via Executor._cleanup_oldest_data), emitting only a logger.debug. The caller then got a generic "not found" for a handle it had legitimately created — indistinguishable from a typo. (Confirmed live: a session-start data handle vanished after ~52 loads with a plain not-found.)

Fix

Track evicted ids in a bounded tombstone deque(maxlen=1024) in both stores, and route every not-found site through a shared helper:

  • HandleManager.describe_missing(id) — used by get_instance/get_info (raise), evaluate, export_code, save_model, release_handle.
  • Executor.data_handle_missing(id) — returns the error string + capped available-handles summary, used by inspect_data, split_data, save_data, transform_data, plot_series, and the executor's own format_data_handle / release_data_handle.

When the id was evicted, the message becomes "'' was evicted (handle limit N reached); reload the source / re-create it with instantiate" instead of "not found". Eviction is now logged at info level.

Testing

  • New tests/test_eviction_tombstones.py (4 tests): estimator + data eviction messages, get_instance raises the eviction message, and inspect_data surfaces it end-to-end; a never-seen id still reads as a plain "not found".
  • Full suite: 254 passed.

🤖 Generated with Claude Code

Both handle stores bulk-evict the oldest entries when they hit their cap
(estimator: 10 oldest; data: oldest ~20%), emitting only a debug log. The
caller then saw a generic "not found" — indistinguishable from a typo — for a
handle it had legitimately created.

Track evicted ids in a bounded tombstone deque in both HandleManager and the
Executor data-handle store, and route every not-found site through a shared
describe_missing / data_handle_missing helper that says
"'<id>' was evicted (handle limit N reached); reload the source / re-create it"
when the id was evicted. Eviction is now logged at info level.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Silent bulk handle eviction reports "not found" — user state vanishes with no warning

1 participant