Skip to content

Commit a71b28c

Browse files
authored
update Grav and use consistent UUID for stream handlers (#162)
1 parent 42f5a7a commit a71b28c

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

atmo/coordinator/coordinator_stream.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package coordinator
33
import (
44
"fmt"
55

6-
"github.com/google/uuid"
76
"github.com/pkg/errors"
87

98
"github.com/suborbital/atmo/atmo/appsource"
@@ -61,7 +60,7 @@ func (c *Coordinator) streamConnectionForDirectiveHandler(handler directive.Hand
6160
req := &request.CoordinatedRequest{
6261
Method: atmoMethodStream,
6362
URL: handler.Input.Resource,
64-
ID: uuid.New().String(),
63+
ID: ctx.RequestID(),
6564
Body: msg.Data(),
6665
Headers: map[string]string{},
6766
RespHeaders: map[string]string{},
@@ -91,7 +90,7 @@ func (c *Coordinator) streamConnectionForDirectiveHandler(handler directive.Hand
9190
replyTopic = handler.RespondTo
9291
}
9392

94-
pod.ReplyTo(msg, grav.NewMsg(replyTopic, result))
93+
pod.ReplyTo(msg, grav.NewMsgWithParentID(replyTopic, ctx.RequestID(), result))
9594

9695
return nil
9796
})

atmo/coordinator/executor/executor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ func (e *Executor) Metrics() (*rt.ScalerMetrics, error) {
263263
}
264264

265265
func connectStaticPeers(log *vlog.Logger, g *grav.Grav, opts *options.Options) {
266+
if strings.TrimSpace(opts.StaticPeers) == "" {
267+
return
268+
}
269+
266270
epts := strings.Split(opts.StaticPeers, ",")
267271

268272
for _, e := range epts {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/pkg/errors v0.9.1
1010
github.com/sethvargo/go-envconfig v0.5.0
1111
github.com/spf13/cobra v1.2.1
12-
github.com/suborbital/grav v0.5.1-0.20220314153349-3932e8bdc3f0
12+
github.com/suborbital/grav v0.5.1-0.20220401153127-41df567a4501
1313
github.com/suborbital/reactr v0.15.1
1414
github.com/suborbital/vektor v0.5.3-0.20220302142328-fb4fc3951eb1
1515
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
409409
github.com/suborbital/grav v0.5.0/go.mod h1:cul5DpYVRAmoUxaqzaKYOpoFCFb9LpzQiCrre2DP0Sg=
410410
github.com/suborbital/grav v0.5.1-0.20220314153349-3932e8bdc3f0 h1:UtjIpXx7WIfv9N6woopVsuP/pjJAwNTv2l76euNru/A=
411411
github.com/suborbital/grav v0.5.1-0.20220314153349-3932e8bdc3f0/go.mod h1:c0Jbycyryjz4RMtiENnvAT8J9yIMGSPt3GpyQJt1TH8=
412+
github.com/suborbital/grav v0.5.1-0.20220401143451-09bfb5fca5ee h1:CvIttAPDmVO7Mz1hlFRcGVmAGhmJWPosqACmr4i7DpU=
413+
github.com/suborbital/grav v0.5.1-0.20220401143451-09bfb5fca5ee/go.mod h1:c0Jbycyryjz4RMtiENnvAT8J9yIMGSPt3GpyQJt1TH8=
414+
github.com/suborbital/grav v0.5.1-0.20220401153127-41df567a4501 h1:PEiRGQPYCILVPR5zqi+Ljo9v5NjVIj9vPxQz8m2Neno=
415+
github.com/suborbital/grav v0.5.1-0.20220401153127-41df567a4501/go.mod h1:c0Jbycyryjz4RMtiENnvAT8J9yIMGSPt3GpyQJt1TH8=
412416
github.com/suborbital/reactr v0.15.1 h1:IJNsh9SiXHp2B4wpTSMseIym4XvAYP7N5fQSADfGwbM=
413417
github.com/suborbital/reactr v0.15.1/go.mod h1:JC+km01xHNSuQDYsxWCBBh7fJrctI1Yai7Mm/Ws3xAU=
414418
github.com/suborbital/vektor v0.5.1/go.mod h1:116rovoAiwxaOzrTf849x54mlaec41qvB1d/9UeA+xk=

0 commit comments

Comments
 (0)