Skip to content

Commit

Permalink
Merge branch 'master' into snowden/dead-code
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden committed Jun 9, 2023
2 parents 0714e8f + 912b889 commit 8f3a8fc
Show file tree
Hide file tree
Showing 28 changed files with 1,811 additions and 907 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Expand Up @@ -5,7 +5,7 @@ linters:
- goerr113
- errcheck
- goimports
- paralleltest
# - paralleltest # missing the call to method parallel, but testify does not seem to work well with parallel test: https://github.com/stretchr/testify/issues/187
- revive # revive supersedes golint, which is now archived
- staticcheck
- vet
Expand Down
26 changes: 5 additions & 21 deletions common/metrics/defs.go
Expand Up @@ -30,14 +30,10 @@ type (
// MetricName is the name of the metric
MetricName string

// MetricType is the type of the metric
MetricType int

MetricUnit string

// metricDefinition contains the definition for a metric
metricDefinition struct {
metricType MetricType // metric type
metricName MetricName // metric name
unit MetricUnit
}
Expand All @@ -51,14 +47,6 @@ const (
Bytes = "By"
)

// MetricTypes which are supported
const (
Counter MetricType = iota
Timer
Gauge
Histogram
)

// Empty returns true if the metricName is an empty string
func (mn MetricName) Empty() bool {
return mn == ""
Expand All @@ -69,10 +57,6 @@ func (mn MetricName) String() string {
return string(mn)
}

func (md metricDefinition) GetMetricType() MetricType {
return md.metricType
}

func (md metricDefinition) GetMetricName() string {
return md.metricName.String()
}
Expand All @@ -82,21 +66,21 @@ func (md metricDefinition) GetMetricUnit() MetricUnit {
}

func NewTimerDef(name string) metricDefinition {
return metricDefinition{metricName: MetricName(name), metricType: Timer, unit: Milliseconds}
return metricDefinition{metricName: MetricName(name), unit: Milliseconds}
}

func NewBytesHistogramDef(name string) metricDefinition {
return metricDefinition{metricName: MetricName(name), metricType: Histogram, unit: Bytes}
return metricDefinition{metricName: MetricName(name), unit: Bytes}
}

func NewDimensionlessHistogramDef(name string) metricDefinition {
return metricDefinition{metricName: MetricName(name), metricType: Histogram, unit: Dimensionless}
return metricDefinition{metricName: MetricName(name), unit: Dimensionless}
}

func NewCounterDef(name string) metricDefinition {
return metricDefinition{metricName: MetricName(name), metricType: Counter}
return metricDefinition{metricName: MetricName(name)}
}

func NewGaugeDef(name string) metricDefinition {
return metricDefinition{metricName: MetricName(name), metricType: Gauge}
return metricDefinition{metricName: MetricName(name)}
}
1 change: 1 addition & 0 deletions common/persistence/client/factory.go
Expand Up @@ -117,6 +117,7 @@ func (f *factoryImpl) NewTaskManager() (p.TaskManager, error) {
if f.metricsHandler != nil && f.healthSignals != nil {
result = p.NewTaskPersistenceMetricsClient(result, f.metricsHandler, f.healthSignals, f.logger)
}
result = p.NewTaskPersistenceRetryableClient(result, retryPolicy, IsPersistenceTransientError)
return result, nil
}

Expand Down
4 changes: 4 additions & 0 deletions config/dynamicconfig/development-cass.yaml
Expand Up @@ -32,3 +32,7 @@
# - value: true
system.enableEagerWorkflowStart:
- value: true
frontend.enableUpdateWorkflowExecution:
- value: true
frontend.enableUpdateWorkflowExecutionAsyncAccepted:
- value: true
4 changes: 4 additions & 0 deletions config/dynamicconfig/development-sql.yaml
Expand Up @@ -35,3 +35,7 @@ system.enableEagerWorkflowStart:
limit.maxIDLength:
- value: 255
constraints: {}
frontend.enableUpdateWorkflowExecution:
- value: true
frontend.enableUpdateWorkflowExecutionAsyncAccepted:
- value: true
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -44,7 +44,7 @@ require (
go.opentelemetry.io/otel/metric v1.16.0
go.opentelemetry.io/otel/sdk v1.16.0
go.opentelemetry.io/otel/sdk/metric v0.39.0
go.temporal.io/api v1.22.0
go.temporal.io/api v1.23.0
go.temporal.io/sdk v1.23.0
go.temporal.io/version v0.3.0
go.uber.org/atomic v1.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -1125,8 +1125,8 @@ go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI
go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.temporal.io/api v1.21.0/go.mod h1:xlsUEakkN2vU2/WV7e5NqMG4N93nfuNfvbXdaXUpU8w=
go.temporal.io/api v1.22.0 h1:XshAWMbKbyJws+brrNe2UCcI501iiIAJAd0uX40yw7s=
go.temporal.io/api v1.22.0/go.mod h1:AcJd1+rc1j0zte+ZBIkOHGHjntR/17LnZWFz+gMFHQ0=
go.temporal.io/api v1.23.0 h1:4y9mTQjEHsE0Du0WJ2ExJUcP/1/a+B/UefzIDm4ALTE=
go.temporal.io/api v1.23.0/go.mod h1:AcJd1+rc1j0zte+ZBIkOHGHjntR/17LnZWFz+gMFHQ0=
go.temporal.io/sdk v1.23.0 h1:oa9/1f3bbcBLiNGbYf9woIx7uWFJ153q0JOkPeZqJtQ=
go.temporal.io/sdk v1.23.0/go.mod h1:S7vWxU01lGcCny0sWx03bkkYw4VtVrpzeqBTn2A6y+E=
go.temporal.io/version v0.3.0 h1:dMrei9l9NyHt8nG6EB8vAwDLLTwx2SvRyucCSumAiig=
Expand Down
7 changes: 4 additions & 3 deletions service/frontend/workflow_handler.go
Expand Up @@ -878,7 +878,7 @@ func (wh *WorkflowHandler) PollWorkflowTaskQueue(ctx context.Context, request *w
return &workflowservice.PollWorkflowTaskQueueResponse{}, nil
}

// For newer build error, return silently.
// These errors are expected based on certain client behavior. We should not log them, it'd be too noisy.
var newerBuild *serviceerror.NewerBuildExists
if errors.As(err, &newerBuild) {
return nil, err
Expand Down Expand Up @@ -1114,7 +1114,7 @@ func (wh *WorkflowHandler) PollActivityTaskQueue(ctx context.Context, request *w
return &workflowservice.PollActivityTaskQueueResponse{}, nil
}

// For newer build error, return silently.
// These errors are expected based on certain client behavior. We should not log them, it'd be too noisy.
var newerBuild *serviceerror.NewerBuildExists
if errors.As(err, &newerBuild) {
return nil, err
Expand Down Expand Up @@ -4871,9 +4871,10 @@ func (wh *WorkflowHandler) cleanScheduleSearchAttributes(searchAttributes *commo

delete(fields, searchattribute.TemporalSchedulePaused)
delete(fields, "TemporalScheduleInfoJSON") // used by older version, clean this up if present
// this isn't schedule-related but isn't relevant to the user for
// these aren't schedule-related but they aren't relevant to the user for
// scheduler workflows since it's the server worker
delete(fields, searchattribute.BinaryChecksums)
delete(fields, searchattribute.BuildIds)

if len(fields) == 0 {
return nil
Expand Down

0 comments on commit 8f3a8fc

Please sign in to comment.