Skip to content

Commit

Permalink
chore: remove experimental
Browse files Browse the repository at this point in the history
Signed-off-by: Valery Piashchynski <[email protected]>
  • Loading branch information
rustatian committed Nov 13, 2023
1 parent 8468b85 commit 74f261c
Show file tree
Hide file tree
Showing 7 changed files with 1,361 additions and 40 deletions.
4 changes: 2 additions & 2 deletions aggregatedpool/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package aggregatedpool

import (
"fmt"
"time"

"github.com/google/uuid"
"github.com/temporalio/roadrunner-temporal/v4/common"
Expand Down Expand Up @@ -49,7 +48,8 @@ func TemporalWorkers(wDef *Workflow, actDef *Activity, wi []*internal.WorkerInfo
zap.Bool("use_buildID_for_versioning", wi[i].Options.UseBuildIDForVersioning),
)

wi[i].Options.WorkerStopTimeout = time.Minute
// just to be sure
wi[i].Options.WorkerStopTimeout = 0

if wi[i].TaskQueue == "" {
wi[i].TaskQueue = temporalClient.DefaultNamespace
Expand Down
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ require (
go.temporal.io/api v1.25.0
go.temporal.io/sdk v1.25.1
go.temporal.io/sdk/contrib/tally v0.2.0
go.temporal.io/server v1.22.1
go.temporal.io/server v1.22.2
go.uber.org/zap v1.26.0
google.golang.org/protobuf v1.31.0
)

require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cactus/go-statsd-client/v5 v5.1.0
Expand All @@ -39,8 +33,10 @@ require (
github.com/gogo/status v1.1.1 // indirect
github.com/golang/mock v1.7.0-rc.1 // indirect
github.com/golang/protobuf v1.5.3
github.com/google/go-cmp v0.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand All @@ -57,6 +53,7 @@ require (
github.com/twmb/murmur3 v1.1.8 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sync v0.5.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ go.temporal.io/sdk v1.25.1 h1:jC9l9vHHz5OJ7PR6OjrpYSN4+uEG0bLe5rdF9nlMSGk=
go.temporal.io/sdk v1.25.1/go.mod h1:X7iFKZpsj90BfszfpFCzLX8lwEJXbnRrl351/HyEgmU=
go.temporal.io/sdk/contrib/tally v0.2.0 h1:XnTJIQcjOv+WuCJ1u8Ve2nq+s2H4i/fys34MnWDRrOo=
go.temporal.io/sdk/contrib/tally v0.2.0/go.mod h1:1kpSuCms/tHeJQDPuuKkaBsMqfHnIIRnCtUYlPNXxuE=
go.temporal.io/server v1.22.1 h1:VmLEy2PZHY9HN7VyL0vaI1EncqGPw6Zl4q/OPTTXHes=
go.temporal.io/server v1.22.1/go.mod h1:UxFq6afGcjhhsi4zbW8uS3op8e0SX56daLO6eeCtm8U=
go.temporal.io/server v1.22.2 h1:n+I0f5CmCIiYJz+7sAeGjpQxL19RsyM67QiSpiaD7eU=
go.temporal.io/server v1.22.2/go.mod h1:fq92tQGzaj3TCt3x4KFeo2N+rA8Vucp6lCwCqNRNR2o=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
Expand Down
1,347 changes: 1,347 additions & 0 deletions go.work.sum

Large diffs are not rendered by default.

29 changes: 3 additions & 26 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ type Plugin struct {
log *zap.Logger
config *Config
statsExporter *metrics.StatsExporter
experimental bool
codec *proto.Codec
actP *static_pool.Pool
wfP *static_pool.Pool
Expand Down Expand Up @@ -139,7 +138,6 @@ func (p *Plugin) Init(cfg common.Configurer, log Logger, server common.Server) e
p.eventBus, p.id = events.NewEventBus()
p.stopCh = make(chan struct{}, 1)
p.statsExporter = newStatsExporter(p)
p.experimental = cfg.Experimental()

// initialize TLS
if p.config.TLS != nil {
Expand Down Expand Up @@ -216,8 +214,9 @@ func (p *Plugin) Serve() chan error {
return errCh
}

func (p *Plugin) Stop(ctx context.Context) error {
func (p *Plugin) Stop(context.Context) error {
p.mu.Lock()
defer p.mu.Unlock()

// stop events
p.eventBus.Unsubscribe(p.id)
Expand All @@ -242,29 +241,7 @@ func (p *Plugin) Stop(ctx context.Context) error {
p.temporal.client.Close()
}

// let the pool continue to work
if !p.experimental {
p.mu.Unlock()
return nil
}

// experimental mode
// we need this loop to let the instances finish their work
p.mu.Unlock()
for {
select {
case <-ctx.Done():
return errors.Errorf("temporal server: timeout exceeded: %v", ctx.Err())
default:
p.mu.RLock()
if p.wfP.QueueSize() == 0 && p.actP.QueueSize() == 0 {
p.mu.RUnlock()
return nil
}
p.mu.RUnlock()
time.Sleep(time.Second)
}
}
return nil
}

func (p *Plugin) Workers() []*process.State {
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ require (
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.temporal.io/sdk/contrib/opentelemetry v0.3.0 // indirect
go.temporal.io/sdk/contrib/tally v0.2.0 // indirect
go.temporal.io/server v1.22.1 // indirect
go.temporal.io/server v1.22.2 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
Expand Down
4 changes: 2 additions & 2 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ go.temporal.io/sdk/contrib/opentelemetry v0.3.0 h1:wOEErZugJF1NcBpcxEAmOQmrcRBw3
go.temporal.io/sdk/contrib/opentelemetry v0.3.0/go.mod h1:V0kUHBikUWh3fb4WufUKXd8tKrFO3isZM+MmrfJKIGM=
go.temporal.io/sdk/contrib/tally v0.2.0 h1:XnTJIQcjOv+WuCJ1u8Ve2nq+s2H4i/fys34MnWDRrOo=
go.temporal.io/sdk/contrib/tally v0.2.0/go.mod h1:1kpSuCms/tHeJQDPuuKkaBsMqfHnIIRnCtUYlPNXxuE=
go.temporal.io/server v1.22.1 h1:VmLEy2PZHY9HN7VyL0vaI1EncqGPw6Zl4q/OPTTXHes=
go.temporal.io/server v1.22.1/go.mod h1:UxFq6afGcjhhsi4zbW8uS3op8e0SX56daLO6eeCtm8U=
go.temporal.io/server v1.22.2 h1:n+I0f5CmCIiYJz+7sAeGjpQxL19RsyM67QiSpiaD7eU=
go.temporal.io/server v1.22.2/go.mod h1:fq92tQGzaj3TCt3x4KFeo2N+rA8Vucp6lCwCqNRNR2o=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
Expand Down

0 comments on commit 74f261c

Please sign in to comment.