Skip to content

fix(kanban): serialize shared board writes - #73328

Open
cbicudo wants to merge 1 commit into
NousResearch:mainfrom
cbicudo:fix/kanban-shared-write-lock
Open

fix(kanban): serialize shared board writes#73328
cbicudo wants to merge 1 commit into
NousResearch:mainfrom
cbicudo:fix/kanban-shared-write-lock

Conversation

@cbicudo

@cbicudo cbicudo commented Jul 28, 2026

Copy link
Copy Markdown

What does this PR do?

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows duplicate This issue or pull request already exists labels Jul 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #67477. Both serialize Kanban SQLite writes using the shared board dispatch lock; #67477 is earlier and covers additional writer and checkpoint paths.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for addressing a real concurrency gap: current write_txn() does not share the dispatch lock (hermes_cli/kanban_db.py:2751-2777), while dispatcher ticks do (hermes_cli/kanban_db.py:8105-8124).

Problems

  • The new _common_write_lock() in de7ae8e7946508ea684cbea0ec81d90cca88d6be assumes conn.execute(...).fetchone()[2]. Existing _FakeConn.execute() returns None in tests/hermes_cli/test_kanban_write_txn_busy_retry.py:28-36, and that file calls write_txn() at lines 61-82. The patch would fail those existing tests before the transaction boundary.
  • The new multiprocessing helper imports fcntl unconditionally, so its regression test is not native-Windows runnable. The current lock implementation explicitly supports Windows at hermes_cli/kanban_db.py:1516-1527.
  • As noted in the member's duplicate comment, fix(kanban): serialize all SQLite writers across processes #67477 is the earlier broader approach. This patch does not cover the direct connection close in hermes_cli/kanban_db.py:2232-2239 or the additional writer/checkpoint paths that PR addresses.

Suggested changes

Automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 30, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Ten PRs address or reference the reported SQLite-corruption complex. The diffs split into broad per-write serialization proposals (#31965, #32461, #35770, #35787, #37292, #37344, #37350, #67477, and #73328) and the merged root-cause fix #71724, which removes raw file-descriptor reads that cancelled live POSIX SQLite locks; later contributor evidence also confounds the original concurrent-WAL-writer premise and identifies #71724 as the better fit for observed real damage.

Related pull requests

Duplicates

#32461, #35770, #35787, #37292, #37344, #37350, #67477, and #73328 overlap on cross-process Kanban write serialization; #35787 and #37292 are effectively the same mixed Kanban/DingTalk change, while #73328 is the narrower duplicate of #67477. #31965 additionally overlaps the already-closed WAL-initialization chain #33482/#33696; #71724 is complementary root-cause work rather than merely another serialization duplicate.

Suggested consolidation

Keep #67477 open with a salvage path: rebase it onto the merged #71724 baseline, retain its shared bounded lock coverage for normal writes and close-time checkpoints, and add the contributor-requested Windows contention, bounded-failure, and unlock-on-exception tests. Close #73328 as a duplicate of #67477 despite its keep-open review because its diff covers only write_txn(), breaks existing fake-connection expectations, lacks native-Windows lock-holder coverage, and omits #67477's additional writer/checkpoint paths; the remaining listed alternatives are already closed, while merged #71724 should remain the root-cause reference for both issues.

Complex graph

flowchart TD
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    I53819(["issue #53819 (open)"])
    subgraph Dup31965 ["PRs duplicating each other"]
        P31965["PR #31965 (closed)"]
        P32461["PR #32461 (closed)"]
        P35770["PR #35770 (closed)"]
        P35787["PR #35787 (closed)"]
        P37292["PR #37292 (closed)"]
        P37344["PR #37344 (closed)"]
        P37350["PR #37350 (closed)"]
        P67477["PR #67477 (open)"]
        P73328["PR #73328 (open)"]
    end
    P73328 -.->|partial| I53819
    class I53819 open
    class P31965 closed
    class P32461 closed
    class P35770 closed
    class P35787 closed
    class P37292 closed
    class P37344 closed
    class P37350 closed
    class P67477 open
    class P73328 open
    class P67477 best
    class P73328 target
    click I53819 "https://github.com/NousResearch/hermes-agent/issues/53819"
    click P31965 "https://github.com/NousResearch/hermes-agent/pull/31965"
    click P32461 "https://github.com/NousResearch/hermes-agent/pull/32461"
    click P35770 "https://github.com/NousResearch/hermes-agent/pull/35770"
    click P35787 "https://github.com/NousResearch/hermes-agent/pull/35787"
    click P37292 "https://github.com/NousResearch/hermes-agent/pull/37292"
    click P37344 "https://github.com/NousResearch/hermes-agent/pull/37344"
    click P37350 "https://github.com/NousResearch/hermes-agent/pull/37350"
    click P67477 "https://github.com/NousResearch/hermes-agent/pull/67477"
    click P73328 "https://github.com/NousResearch/hermes-agent/pull/73328"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 10 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 155 kB of PR diffs, 33 kB of issue/PR text, 43 kB of discussion (34 comments), 16 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

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

Labels

comp/cron Cron scheduler and job management duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants