Skip to content

Commit

Permalink
Update proto files and dependencies (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin committed Jun 4, 2020
1 parent d06e307 commit ba7072e
Show file tree
Hide file tree
Showing 19 changed files with 202 additions and 100 deletions.
3 changes: 2 additions & 1 deletion canary/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"time"

"github.com/uber-go/tally"
"go.temporal.io/temporal"
"go.temporal.io/temporal/workflow"
)

Expand Down Expand Up @@ -103,7 +104,7 @@ func recordWorkflowEnd(scope tally.Scope, elapsed time.Duration, err error) erro
return err
}
scope.Counter(failedCount).Inc(1)
if _, ok := err.(*workflow.TimeoutError); ok {
if _, ok := err.(*temporal.TimeoutError); ok {
scope.Counter(errTimeoutCount).Inc(1)
}
return err
Expand Down
3 changes: 2 additions & 1 deletion canary/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"fmt"
"time"

"go.temporal.io/temporal"
"go.temporal.io/temporal/activity"
"go.temporal.io/temporal/workflow"
"go.uber.org/zap"
Expand Down Expand Up @@ -63,7 +64,7 @@ func timeoutWorkflow(ctx workflow.Context, scheduledTimeNanos int64, namespace s

activityErr := activityFuture.Get(ctx, nil)
if activityErr != nil {
if _, ok := activityErr.(*workflow.TimeoutError); !ok {
if _, ok := activityErr.(*temporal.TimeoutError); !ok {
workflow.GetLogger(ctx).Info("activity timeout failed", zap.Error(activityErr))
} else {
activityErr = nil
Expand Down
10 changes: 8 additions & 2 deletions common/payloads/payloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ var (
)

func EncodeString(str string) *commonpb.Payloads {
// Error can be safely ignored here becase string always can be converted to JSON
// Error can be safely ignored here becase string always can be converted to JSON.
ps, _ := dataConverter.ToData(str)
return ps
}

func EncodeInt(i int) *commonpb.Payloads {
// Error can be safely ignored here becase int always can be converted to JSON.
ps, _ := dataConverter.ToData(i)
return ps
}

func EncodeBytes(bytes []byte) *commonpb.Payloads {
// Error can be safely ignored here becase []byte always can be raw encoded
// Error can be safely ignored here becase []byte always can be raw encoded.
ps, _ := dataConverter.ToData(bytes)
return ps
}
Expand Down
10 changes: 10 additions & 0 deletions common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,3 +565,13 @@ func GetDefaultAdvancedVisibilityWritingMode(isAdvancedVisConfigExist bool) stri
}
return AdvancedVisibilityWritingModeOff
}

func GetPayloadsMapSize(data map[string]*commonpb.Payloads) int {
size := 0
for key, payloads := range data {
size += len(key)
size += payloads.Size()
}

return size
}
30 changes: 15 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/temporalio/temporal
go 1.14

require (
cloud.google.com/go/storage v1.8.0
cloud.google.com/go/storage v1.9.0
github.com/Shopify/sarama v1.26.4
github.com/apache/thrift v0.0.0-20161221203622-b2a4d4ae21c7 // indirect
github.com/aws/aws-sdk-go v1.31.1
github.com/aws/aws-sdk-go v1.31.11
github.com/benbjohnson/clock v1.0.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bitly/go-hostpool v0.1.0 // indirect
Expand All @@ -30,10 +30,11 @@ require (
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect
github.com/hashicorp/go-version v1.2.0
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/jcmturner/gokrb5/v8 v8.3.0 // indirect
github.com/jmoiron/sqlx v1.2.0
github.com/jonboulle/clockwork v0.1.0
github.com/klauspost/compress v1.10.5 // indirect
github.com/lib/pq v1.5.2
github.com/klauspost/compress v1.10.7 // indirect
github.com/lib/pq v1.6.0
github.com/m3db/prometheus_client_golang v0.8.1
github.com/m3db/prometheus_client_model v0.1.0 // indirect
github.com/m3db/prometheus_common v0.1.0 // indirect
Expand All @@ -44,7 +45,7 @@ require (
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/olekukonko/tablewriter v0.0.4
github.com/olivere/elastic v6.2.31+incompatible
github.com/olivere/elastic v6.2.32+incompatible
github.com/onsi/ginkgo v1.10.3 // indirect
github.com/onsi/gomega v1.7.1 // indirect
github.com/opentracing/opentracing-go v1.1.0
Expand All @@ -55,31 +56,30 @@ require (
github.com/robfig/cron v1.2.0
github.com/sirupsen/logrus v1.6.0
github.com/streadway/quantile v0.0.0-20150917103942-b0c588724d25 // indirect
github.com/stretchr/testify v1.5.1
github.com/stretchr/testify v1.6.0
github.com/uber-common/bark v1.3.0 // indirect
github.com/uber-go/kafka-client v0.2.3-0.20191018205945-8b3555b395f9
github.com/uber-go/tally v3.3.16+incompatible
github.com/uber-go/tally v3.3.17+incompatible
github.com/uber/ringpop-go v0.8.5
github.com/uber/tchannel-go v1.18.0
github.com/uber/tchannel-go v1.19.0
github.com/urfave/cli v1.22.4
github.com/valyala/fastjson v1.5.1
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
go.temporal.io/temporal v0.23.2
go.temporal.io/temporal-proto v0.23.2
go.temporal.io/temporal v0.23.5
go.temporal.io/temporal-proto v0.23.3
go.uber.org/atomic v1.6.0
go.uber.org/multierr v1.5.0
go.uber.org/zap v1.15.0
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1
golang.org/x/tools v0.0.0-20200519205726-57a9e4404bf7 // indirect
google.golang.org/api v0.24.0
golang.org/x/tools v0.0.0-20200604183345-4d5ea46c79fe // indirect
google.golang.org/api v0.26.0
google.golang.org/genproto v0.0.0-20200604104852-0b0486081ffb // indirect
google.golang.org/grpc v1.29.1
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/validator.v2 v2.0.0-20191107172027-c3144fdedc21
gopkg.in/yaml.v2 v2.3.0
honnef.co/go/tools v0.0.1-2020.1.4 // indirect
)

// TODO https://github.com/uber/cadence/issues/2863
Expand Down
Loading

0 comments on commit ba7072e

Please sign in to comment.