Skip to content

[P0-3/P0-4 fix] Route hydra_config bootstrap through CONFIGURE(0x40) task queue #52

Description

@hydra-z

Fix for #49 P0-3 and P0-4

Problem

P0-3: meta is never populated after inline hydra_config first load — update_meta() only called at startup, not after apply_t3_rebuild() in the inline path.

P0-4: apply_t3_rebuild() is called from HTTP worker thread (line 6669) without mutex, racing the main task-queue thread that accesses the same ctx_tgt/model_tgt/slots state.

Fix

Remove the inline HTTP bootstrap from post_chat_completions entirely. Instead:

  1. Remove the && ctx_tgt guard in process_single_task() (server-context.cpp:3259,3265) — now unnecessary since fork: hydra_config inline T3 + hydra_metrics response (hydra_vortex #411) #48 made T3 statics ctx-independent
  2. Enqueue a CONFIGURE(0x40) task instead of adding a second synchronous HTTP-thread path
  3. This fixes P0-3 (meta gets populated via existing CONFIGURE path), P0-4 (no more HTTP-thread race), and P1-5 (no more shared hydra_metrics_result)

Files to modify

  • tools/server/server-context.cpp — Remove inline hydra_config block from post_chat_completions (lines 6633-6689)
  • tools/server/server-context.cpp — Remove && ctx_tgt guard in CONFIGURE handler (lines 3259,3265)

Verification

  • Build: cmake --build build_sm120 --target llama-engine
  • Test: Start engine without --model, send CONFIGURE with model_path
  • Check: meta populated, no null-deref, no race under concurrent load

E2E confirmation

Source analysis confirmed: inline path bypasses task queue, races main thread, never populates meta. CONFIGURE(0x40) path is the documented, queue-mediated mechanism that already works on both binaries.

Cross-repo

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 workinghydra-forkHydra fork-specific changep0-criticalreview-findingFinding created from code review

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions