Skip to content

Commit 4c5c2be

Browse files
committed
call pingcancel on shutdown. Shouldn't need it?
1 parent e326a2f commit 4c5c2be

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dbos/conductor.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"fmt"
77
"log/slog"
8-
"math"
98
"net"
109
"net/url"
1110
"os"
@@ -118,6 +117,10 @@ func (c *Conductor) Shutdown(timeout time.Duration) {
118117
c.stopOnce.Do(func() {
119118
c.logger.Info("Shutting down conductor")
120119

120+
if c.pingCancel != nil {
121+
c.pingCancel()
122+
}
123+
121124
done := make(chan struct{})
122125
go func() {
123126
c.wg.Wait()
@@ -876,13 +879,9 @@ func (c *Conductor) handleForkWorkflowRequest(data []byte, requestID string) err
876879
if req.Body.StartStep < 0 {
877880
return fmt.Errorf("invalid StartStep: cannot be negative")
878881
}
879-
// Additional validation to prevent integer overflow when converting to uint
880-
if req.Body.StartStep > math.MaxInt {
881-
return fmt.Errorf("invalid StartStep: value too large")
882-
}
883882
input := ForkWorkflowInput{
884883
OriginalWorkflowID: req.Body.WorkflowID,
885-
StartStep: uint(req.Body.StartStep),
884+
StartStep: uint(req.Body.StartStep), // #nosec G115 -- validated above
886885
}
887886

888887
// Set optional fields

0 commit comments

Comments
 (0)