Bug: release_agent_slot not called in nohup subshell #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
release_agent_slot is a bash function in kugetsu, but cmd_delegate runs:
sh -c spawns a new shell where release_agent_slot is not defined.
Symptom
Agent count increments but never decrements after task completes.
Fix
Change
sh -ctobash -cand source kugetsu before calling release_agent_slot.Test Results
Fix verified: Changed
sh -ctobash -cand addedsource $(which kugetsu)beforerelease_agent_slot.Test: 3 quick delegates, count went 0 -> 3 -> 0 after ~10-15 seconds. Release works correctly now.
Note: There is a ~10-15 second delay before release happens because sourcing the full kugetsu script takes time. Could optimize by extracting
release_agent_slotto a separate lightweight script.I heard that changing sh -c to bash -c introduce a new error. can you check?
Investigation Result
The
release-slot.shscript still exists and is called bycmd_delegate(line 576), but:acquire_agent_slot()+release-slot.sh(old slot mechanism)count_active_dev_sessions()(new session-counting)These are inconsistent - delegate is still using the broken slot approach while start uses proper session-counting.
Recommendation
Remove slot-based counting from
cmd_delegatesince:This may be why #63 seemed partially fixed but issues persisted.