Skip to content

Commit 5b518c5

Browse files
authored
Remove timeout from spawning process manager prepare workload (#306)
Co-authored-by: kt <[email protected]>
1 parent 674ccbb commit 5b518c5

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

Diff for: internal/node/processmanager/spawn_procman.go

+8-11
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,16 @@ func (s *SpawningProcessManager) EnterLameDuck() error {
108108

109109
// Attaches a deployment request to a running process. Until a process is prepared, it's just an empty agent
110110
func (s *SpawningProcessManager) PrepareWorkload(workloadID string, deployRequest *agentapi.DeployRequest) error {
111-
select {
112-
case proc := <-s.warmProcs:
113-
if proc == nil {
114-
return fmt.Errorf("could not prepare workload, no agent process")
115-
}
116-
proc.deployRequest = deployRequest
117-
proc.workloadStarted = time.Now().UTC()
118-
119-
s.deployRequests[proc.ID] = deployRequest
120-
case <-time.After(500 * time.Millisecond):
121-
return fmt.Errorf("timed out waiting for available agent process")
111+
proc := <-s.warmProcs
112+
if proc == nil {
113+
return fmt.Errorf("could not prepare workload, no available agent process")
122114
}
123115

116+
proc.deployRequest = deployRequest
117+
proc.workloadStarted = time.Now().UTC()
118+
119+
s.deployRequests[proc.ID] = deployRequest
120+
124121
return nil
125122
}
126123

0 commit comments

Comments
 (0)