fetch_ml/internal/scheduler/service_manager_windows.go
Jeremie Fraeys 43e6446587
feat(scheduler): implement multi-tenant job scheduler with gang scheduling
Add new scheduler component for distributed ML workload orchestration:
- Hub-based coordination for multi-worker clusters
- Pacing controller for rate limiting job submissions
- Priority queue with preemption support
- Port allocator for dynamic service discovery
- Protocol handlers for worker-scheduler communication
- Service manager with OS-specific implementations
- Connection management and state persistence
- Template system for service deployment

Includes comprehensive test suite:
- Unit tests for all core components
- Integration tests for distributed scenarios
- Benchmark tests for performance validation
- Mock fixtures for isolated testing

Refs: scheduler-architecture.md
2026-02-26 12:03:23 -05:00

34 lines
964 B
Go

//go:build windows
// +build windows
package scheduler
import (
"os/exec"
)
// setProcessGroup is a no-op on Windows (process groups work differently)
func setProcessGroup(cmd *exec.Cmd) {
// Windows doesn't use Setpgid like Unix
// Process cleanup is handled differently via job objects or direct process kill
}
// killProcessGroup kills the process on Windows
func killProcessGroup(cmd *exec.Cmd) {
if cmd != nil && cmd.Process != nil {
// On Windows, we can only kill the process directly
_ = cmd.Process.Kill()
}
}
// isProcessRunning checks if a process is still running on Windows
func isProcessRunning(cmd *exec.Cmd) bool {
if cmd == nil || cmd.Process == nil {
return false
}
// On Windows, try to get process exit code - if it fails, process is still running
// A simpler approach: try to open the process handle
// For now, we just check if Process object exists
// A more robust implementation would use Windows API
return true
}