Skip to content

Commit

Permalink
add timeout for signalflow metadata request (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcoleAL committed Apr 24, 2024
1 parent 5f09675 commit 9276a1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/job_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ func (jr *SignalFlowJobRunner) ReplaceOrStartJob(ctx context.Context, program st

// Wait for the handle to come through before sending the message to block
// the loop less.
handle, err := comp.Handle(ctx)
ctxWithTimeout, cancel := context.WithTimeout(ctx, jr.MetadataTimeout)
handle, err := comp.Handle(ctxWithTimeout)
cancel()
if err != nil {
// It's possible that the job has already started but the server was delayed sending the handle
// to avoid leaking jobs, issue delete using the channel name, ie: detach.
Expand Down

0 comments on commit 9276a1d

Please sign in to comment.