* Fix: Add -admin.grpc flag to worker for explicit gRPC port configuration * Fix(helm): Add adminGrpcServer to worker configuration * Refactor: Support host:port.grpcPort address format, revert -admin.grpc flag * Helm: Conditionally append grpcPort to worker admin address * weed/admin: fix "send on closed channel" panic in worker gRPC server Make unregisterWorker connection-aware to prevent closing channels belonging to newer connections. * weed/worker: improve gRPC client stability and logging - Fix goroutine leak in reconnection logic - Refactor reconnection loop to exit on success and prevent busy-waiting - Add session identification and enhanced logging to client handlers - Use constant for internal reset action and remove unused variables * weed/worker: fix worker state initialization and add lifecycle logs - Revert workerState to use running boolean correctly - Prevent handleStart failing by checking running state instead of startTime - Add more detailed logs for worker startup events
This commit is contained in:
@@ -195,7 +195,7 @@ func NewWorker(config *types.WorkerConfig) (*Worker, error) {
|
||||
|
||||
func (w *Worker) managerLoop() {
|
||||
w.state = &workerState{
|
||||
startTime: time.Now(),
|
||||
running: false,
|
||||
stopChan: make(chan struct{}),
|
||||
currentTasks: make(map[string]*types.TaskInput),
|
||||
}
|
||||
@@ -428,6 +428,7 @@ func (w *Worker) Start() error {
|
||||
|
||||
// Start starts the worker
|
||||
func (w *Worker) handleStart(cmd workerCommand) {
|
||||
glog.Infof("Worker %s handleStart called", w.id)
|
||||
if w.state.running {
|
||||
cmd.resp <- fmt.Errorf("worker is already running")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user