feat(kugetsu): add lock mechanism for worktree coordination #90
Closed
shoko
wants to merge 1 commits from
feat/issue-71-lock-mechanism into main
pull from: feat/issue-71-lock-mechanism
merge into: shoko:main
shoko:main
shoko:fix/issue-254
shoko:fix/issue-252
shoko:fix/issue-248
shoko:fix/issue-246
shoko:fix/issue-165
shoko:fix/issue-158
shoko:fix/issue-244
shoko:fix/issue-121
shoko:fix/issue-119
shoko:fix/issue-166
shoko:fix/issue-229-pr-conflict-check
shoko:fix/issue-212
shoko:fix/issue-229-user-message-with-base-workflow
shoko:fix/issue-229-ensure-session-worktree-bug
shoko:fix/issue-168
shoko:fix/issue-225-cmd-continue-message-truncation
shoko:fix/issue-223-pr-creation-instructions
shoko:fix/issue-220-pm-context-enhancement
shoko:fix/issue-210-msg-file-race-condition
shoko:fix/issue-207-queue-daemon-set-debug-mode
shoko:fix/issue-message-encoding
shoko:fix/issue-118
shoko:fix/issue-daemon-worktree-session-handling
shoko:fix/issue-write-index-quoting
shoko:fix/issue-cmd-destroy-unbound-var
shoko:fix/issue-daemon-worktree-path-fix
shoko:fix/issue-syntax-error-372
shoko:fix/issue-187-start-forks-agent
shoko:fix/issue-185-worktree-wrong-directory
shoko:fix/issue-183-destroy-base-requires-target
shoko:fix/issue-181-get-repo-url-strips-user-org
shoko:fix/issue-179-worktree-path-doubled
shoko:fix/issue-176-extract-issue-ref
shoko:fix/issue-174-queue-daemon-crashes
shoko:fix/issue-172-init-script-wrong-session-ids
shoko:fix/issue-170-duplicate-update-queue
shoko:fix/issue-167-notification-bash
shoko:fix/issue-156-queue-fixes
shoko:fix/issue-155-queue-list-json
shoko:fix/issue-160-gitea-token-from-pm-agent
shoko:fix/issue-156
shoko:fix/issue-150
shoko:fix/issue-116-modularize-script
shoko:fix/issue-120
shoko:fix/issue-144-parse-issue-ref-format-v2
shoko:fix/issue-queue-daemon-excess-agents
shoko:fix/issue-142-process-queue-missing-parens
1 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3fa9bee166 |
feat(kugetsu): add lock mechanism for worktree coordination
Add lock mechanism to prevent concurrent access to worktrees: - Add LOCKS_DIR constant (\~/.kugetsu/locks) - Add acquire_lock() - acquires lock file with PID, session_id, timestamp - Add release_lock() - releases lock if held by current process - Add release_all_locks() - releases all locks for a session - Add check_lock() - check if issue is locked - Modify cmd_start to acquire lock before creating worktree - Modify cmd_destroy to release lock when destroying session - Add trap for cleanup on EXIT/INT/TERM Lock files are named after issue ref with format: <issue-ref>.lock Contains: PID:session_id:timestamp Stale lock detection: if PID no longer exists, lock is considered stale. This prevents concurrent processes from modifying the same worktree. Fixes #71 |