Skip to content

fix(daemon): bound the handshake profile-identity binding on connection serving #898

Description

@ScriptedAlchemy

connection_serving.rs:746 and :1468 await bind_authenticated_profile_identity inside a tokio::select! whose only other arm is peer_fully_closed_after_eof(), so the stage is unbounded. It reaches registered_profile_database()session_runtime_registry() → a cold DaemonSessionRuntimeRegistryV1::open; the 500 ms PROJECT_OPEN_REQUEST_DEADLINE applies only later in portable_project_server_for_request. Under load a contended cold registry open pins the connection instead of yielding the warming refusal.

Symptoms on Test Linux (Elapsed at the 2 s bound): daemon::tests::bootstrap::direct_tool_cache_miss_returns_warming_while_project_opens_in_background, handshake::{daemon_refreshes_once_only_after_generation_change, initialized_ack_preserves_pending_catalog_refresh_notification}, socket::{portable_broker_routes_multiple_closed_invocations…, socket_client_requires_user_storage_scope_without_project, socket_client_routes_multiple_closed_invocations…, user_session_read_bypasses_unregistered_project_route}, all through the same half-close round-trip helper. Isolated, direct_tool_cache_miss… fails differently (bootstrap.rs:3308, no error message) because it blocks WriterScope::Daemon while a project open takes a project-scoped writer, so its blocking lever is stale.

Fix: apply the same deadline to the binding stage (or move it inside the deadline), then re-point the test at a lever that gates a cold open. Diagnosed 2026-09-05 (hauler cc-5830).

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions