Skip to content

Conversation

@dapi
Copy link
Owner

@dapi dapi commented Jan 21, 2026

Summary

  • When --lock <port> is used on a busy port, it now registers the port as "external" instead of failing
  • Added SOURCE column to --list output showing allocation source (free/lock/external)
  • Added --refresh command to clean up stale external port allocations
  • External allocations store process information (PID, user, process name)

Changes

  • allocations.go: Added Status, LockedAt, ExternalPID, ExternalUser, ExternalProcessName fields to AllocationInfo
  • allocations.go: Added SetExternalAllocation() and RefreshExternalAllocations() methods
  • logger.go: Added ALLOC_EXTERNAL and ALLOC_REFRESH logging events
  • main.go: Modified --lock to handle busy ports (same directory → locked, different directory → external)
  • main.go: Updated --list to show SOURCE column
  • main.go: Added new --refresh command
  • tests: Added unit tests for Store methods and updated integration tests
  • docs: Updated README.md, README.ru.md, CHANGELOG.md

Test plan

  • All existing tests pass
  • New unit tests for SetExternalAllocation and RefreshExternalAllocations
  • Updated TestLockPortInUseByAnotherProcess to expect success
  • Documentation updated in both English and Russian

🤖 Generated with Claude Code

dapi and others added 2 commits January 21, 2026 23:25
When --lock <PORT> is used on a busy port, it now registers the port
as "external" instead of failing. This prevents allocation conflicts
while keeping track of all busy ports.

- Add SOURCE column to --list (free/lock/external)
- Add --refresh command to clean up stale external ports
- Store external process info (PID, user, process name)
- Add new logging events: ALLOC_EXTERNAL, ALLOC_REFRESH

Co-Authored-By: Claude <noreply@anthropic.com>
- Use AllocExternal event in SetExternalAllocation() instead of AllocAdd/AllocUpdate
- Remove double-read of allocations: save externalProcessName inside WithStore
- Type Status field as AllocationStatus instead of string
- Rename StatusLocked to StatusNormal with accurate comment
- Set LockedAt timestamp in all SetLocked* methods (remove duplication from main.go)
- Panic on nil PortChecker in RefreshExternalAllocations (programming error)
- Add integration tests for --refresh and --list SOURCE column

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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