You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(controller): add concurrent operation locking and client isolation
- Add `Stopping()` method to Core to check if xray is in stopping state
- Improve xray startup error messages to distinguish between crashes and interruptions
- Add `syncMu` mutex to Xray to serialize user sync/update operations and prevent race conditions
- Add `controlMu` mutex to Controller to serialize control operations across Start/Stop requests
- Add `IsCurrentClient()` method to validate that operations come from the controlling client
- Add `LockControl()` and `UnlockControl()` methods to Controller for operation serialization
- Add `requestClientIP()` helper to extract and validate client IP from requests
- Add `validateCurrentClient` middleware to REST API to enforce single-client control
- Apply client validation in Start/Stop endpoints to reject requests from non-controlling clients
- Apply concurrent operation locking in user sync, update, and restart operations
- Prevents concurrent user modifications and ensures atomic state transitions
- Ensures only the current controlling client can perform control operations
- Fixes potential race conditions and improves multi-client isolation
0 commit comments