Skip to content

fix(storage): fix deadlock in SessionStore::create_session - #170

Merged
ULookup merged 11 commits into
mainfrom
infra-fixes-2026-06-20
Jun 22, 2026
Merged

fix(storage): fix deadlock in SessionStore::create_session#170
ULookup merged 11 commits into
mainfrom
infra-fixes-2026-06-20

Conversation

@ULookup

@ULookup ULookup commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes a mutex deadlock in SessionStore::create_session() where std::mutex is locked recursively via get_session(id), causing the /v1/sessions endpoint to hang indefinitely
  • Changed std::mutex to std::recursive_mutex to support the re-entrant lock pattern

Root Cause

create_session() acquires mutex_, then calls get_session(id) which also tries to lock the same std::mutex. On Linux with pthreads, this is undefined behavior and results in a deadlock — the session row gets inserted into PostgreSQL but the HTTP handler thread blocks forever, never sending a response.

Test plan

  • POST /v1/sessions returns 201 with session JSON (was hanging/timeout before)
  • POST /api/worldbuilding/worlds returns 200 with world JSON
  • Web UI "创建世界" flow works end-to-end

ULookup added 11 commits June 22, 2026 03:41
create_session() calls get_session() while holding mutex_, but
get_session attempts to lock the same non-recursive std::mutex,
causing a deadlock. The session row is inserted into PostgreSQL
but the HTTP response is never sent, hanging the /v1/sessions endpoint.

Change std::mutex to std::recursive_mutex to fix the re-entrant lock.
…N.md

4-layer plan: CSS variable rewrite (warm monochrome), DesktopShell glass/blur
unification, hardcoded color audit, interaction flow & animation tokens.
When running from build/cli/, the fallback path ../config/pipelines
resolves to build/config/pipelines which doesn't exist. Add a second
fallback that goes up two levels to find config/pipelines at the
project root, covering the dev/build-from-source layout.
… calls

When thinking mode is enabled, DeepSeek requires assistant thinking blocks
to be echoed back in subsequent requests. The provider only preserved
content blocks (thinking/redacted_thinking) when the assistant message
had tool_calls, dropping them for text-only responses. This caused HTTP
400 errors on any follow-up turn after a thinking-enabled response.

Also add error_body to the 4xx error message for better diagnostics.
Covers: global CSS tokens, DesktopShell glass/blur unification, hardcoded
color replacement, page/agent/tab transition animations.
Replace ~30 occurrences of rgba(224,223,220,0.92) and similar variants
with var(--border-subtle) across 10 component CSS files.
- PipelineNavigator: error/complete banners, confirm dialog, condMet → CSS variables
- ChapterEditor: --hover → rgba(23,23,23,0.055), --violet → --muted-strong
- HelpDrawer, WorldOnboarding, EndSceneModal: --brand-wash → --surface-muted
- WorldSelector: backdrop and danger button colors → CSS variables
- Sidebar: sessionItemActive border-color → --border-strong
- InspectorPanel: tabFadeIn animation on content area (180ms)
- MainPanel: agentFadeIn animation on ChatTimeline wrapper keyed by agentId
- Reduced-motion overrides for both animations
Keep DESIGN.md warm grey palette, --border-subtle, animation tokens,
and the body::before dot grid. Merge in input/a:focus-visible
selectors from main.
@ULookup
ULookup merged commit 75a93f4 into main Jun 22, 2026
0 of 6 checks passed
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.

1 participant