Skip to content

Make runtime model registry refresh idempotent and concurrency-safe #5466

Description

@amumu96

Context

The worker update_model_type path can call register_builtin_model repeatedly while model launches continue on executor threads.

Current problems

  • Built-in engine class lists use unconditional extend calls and grow on every refresh.
  • Some live global model tables are cleared and rebuilt during refresh.
  • Embedding and rerank derived engine entries can accumulate across repeated installs.
  • Readers can observe partially rebuilt state or race with dictionary-size changes.

This behavior predates the startup engine-hook work in #5465; that PR now guarantees its callbacks run only during initial bootstrap and therefore does not address the host registry refresh itself.

Expected behavior

  • Repeated registry refreshes are idempotent.
  • Built-in class and derived engine entries do not grow across refreshes.
  • Live readers observe a consistent registry snapshot.
  • Add regression coverage for repeated LLM, embedding, and rerank refreshes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrefactor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions