Skip to content

Conversation

@sai-kumar-peddireddy
Copy link
Collaborator

@sai-kumar-peddireddy sai-kumar-peddireddy commented Nov 25, 2025

Description

  • Real-time Updates: Eliminates polling delay for hosts with WebSocket support
  • Reduced Load: Significantly decreases API calls for event monitoring
  • Backward Compatible: Gracefully falls back to polling for legacy hosts
  • Scalable: Efficient connection pooling and resource management
  • Resilient: Automatic reconnection and error recovery mechanisms

Part of #321

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run tests that prove my fix is effective or that my feature works
  • I have updated the CHANGELOG.md file accordingly

…tor hosts

This commit introduces a comprehensive WebSocket infrastructure for orchestrator
hosts, enabling real-time event streaming and health monitoring with intelligent
fallback to polling for hosts that don't support WebSockets.
@sai-kumar-peddireddy
Copy link
Collaborator Author

These requirements are still pending from #330 . I will implement them in next PR

  • We need to have new health messsages for each host emitted by the orchestrator to its inbox
  • We need to have the orchestrator issue new events for the VM state changes either when we receive them from the web socket or every tick in the old system
  • We need unit tests for this new functionality

cjlapao and others added 3 commits November 26, 2025 11:38
…tHost

- Added periodic ping routine (every 30s) to keep WebSocket connections alive
- Fixed race condition in persistHost() where ping/pong updates would prevent HTTP health check data from being saved
- Now uses newer UpdatedAt timestamp while still persisting all health check data
@boring-cyborg boring-cyborg bot added the test Tests label Nov 27, 2025
…dd unit tests

- Added read and write locks using dataMutex in orchestrator.go to ensure thread safety for database operations.
- Introduced helper methods for unsafe operations to separate concerns and maintain clean code.
- Created a comprehensive test suite in orchestrator_test.go to validate the functionality of orchestrator host management, including creation, retrieval, updating, and deletion.
- Implemented tests for error scenarios, including duplicate hosts and not found cases.
- Verified resource management functions to ensure accurate calculations of available, total, in-use, and reserved resources.
@sai-kumar-peddireddy sai-kumar-peddireddy merged commit 7bae6e7 into main Nov 28, 2025
15 checks passed
@sai-kumar-peddireddy sai-kumar-peddireddy deleted the orchestrator-websock branch November 28, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants