diff --git a/go.mod b/go.mod index cd943760..071b0207 100644 --- a/go.mod +++ b/go.mod @@ -8,17 +8,17 @@ require ( github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.3.0 github.com/pborman/uuid v1.2.1 - github.com/roadrunner-server/api/v2 v2.8.0-rc.6 - github.com/roadrunner-server/config/v2 v2.8.0 + github.com/roadrunner-server/api/v2 v2.9.0 + github.com/roadrunner-server/config/v2 v2.9.0 github.com/roadrunner-server/endure v1.2.1 github.com/roadrunner-server/errors v1.1.1 github.com/roadrunner-server/goridge/v3 v3.3.1 - github.com/roadrunner-server/informer/v2 v2.8.0 - github.com/roadrunner-server/logger/v2 v2.8.0 - github.com/roadrunner-server/resetter/v2 v2.8.0 - github.com/roadrunner-server/rpc/v2 v2.8.0 - github.com/roadrunner-server/sdk/v2 v2.8.0 - github.com/roadrunner-server/server/v2 v2.8.0 + github.com/roadrunner-server/informer/v2 v2.9.0 + github.com/roadrunner-server/logger/v2 v2.9.0 + github.com/roadrunner-server/resetter/v2 v2.9.0 + github.com/roadrunner-server/rpc/v2 v2.9.0 + github.com/roadrunner-server/sdk/v2 v2.9.1 + github.com/roadrunner-server/server/v2 v2.9.2 github.com/stretchr/testify v1.7.0 github.com/uber-go/tally/v4 v4.1.1 go.temporal.io/api v1.7.0 diff --git a/go.sum b/go.sum index eec0cec1..ae789199 100644 --- a/go.sum +++ b/go.sum @@ -58,6 +58,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -274,6 +275,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.14.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.14.2/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -362,10 +365,10 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/roadrunner-server/api/v2 v2.8.0-rc.6 h1:UBskvT2N2ScRMCtU5nMXZouZ6RTgNYaJmy9Qy90OxZc= -github.com/roadrunner-server/api/v2 v2.8.0-rc.6/go.mod h1:XWMqgPq/8pKIwCYnPsZI761el0XE5WR4EKuNnTci/VA= -github.com/roadrunner-server/config/v2 v2.8.0 h1:b/pP01WJOQucs4d/GpgVfN90btvK2JKMUVrgYoc07lg= -github.com/roadrunner-server/config/v2 v2.8.0/go.mod h1:d9smSQ10xlA1RBBBUp0kuK1iH4A8T0VVRczPFDgtlBQ= +github.com/roadrunner-server/api/v2 v2.9.0 h1:bTv6xxrr5YhD7HXN78O8D+tylcl1eVjdseaHx3K19rY= +github.com/roadrunner-server/api/v2 v2.9.0/go.mod h1:jQ0rWRiuVozw4G8ASgx0YEwxDqMOD4NdestaJanPcM0= +github.com/roadrunner-server/config/v2 v2.9.0 h1:h6qIVW6Au9vxxKUjvXVxgQOmnEMSFlKnQiw3tEgPF2U= +github.com/roadrunner-server/config/v2 v2.9.0/go.mod h1:2Fm5WzbjuqPno/oc10EhfIRYCW4iz2d2A0MYn3xGdb0= github.com/roadrunner-server/endure v1.2.1 h1:LwapekBTGlsgEXR6Fbp50WYIjAGq/FwTssZThemyawE= github.com/roadrunner-server/endure v1.2.1/go.mod h1:36kWruojFlPhtsP/is8wVtWGYuGGxUWDVnn1TTBbbas= github.com/roadrunner-server/errors v1.1.0/go.mod h1:MzHjhRZIZc1ooMyYllUhNs0aTqRUbwcgUSO0TN7kCII= @@ -373,18 +376,18 @@ github.com/roadrunner-server/errors v1.1.1 h1:BzrB+xZE+iTISVfXSzIL9YbpPt6oHoRHgO github.com/roadrunner-server/errors v1.1.1/go.mod h1:MzHjhRZIZc1ooMyYllUhNs0aTqRUbwcgUSO0TN7kCII= github.com/roadrunner-server/goridge/v3 v3.3.1 h1:IYdm+smDfKl09AfFgKJeSNpSTp7KTgO3XfGPKrxs0vQ= github.com/roadrunner-server/goridge/v3 v3.3.1/go.mod h1:f7SPSt9HUw5kbCc6Ofk4eEUU1xh2qHf/NznrTaW+aLA= -github.com/roadrunner-server/informer/v2 v2.8.0 h1:cJbqc9MQUwR1YyXQkbb/YA+MuqjWwD56CUTmqG1af8U= -github.com/roadrunner-server/informer/v2 v2.8.0/go.mod h1:ziTX04vmiF6JoX2CJDV3QDFkka8B9hGxjRbWrGUCT70= -github.com/roadrunner-server/logger/v2 v2.8.0 h1:1EgWCCrvo8v0TCkpffjeMaJ13QFp0WnRIp0oCrN5+vw= -github.com/roadrunner-server/logger/v2 v2.8.0/go.mod h1:uS7nmR8pAC486koVZrRe4Nm6m1PWDjLx846Bt/4BUJU= -github.com/roadrunner-server/resetter/v2 v2.8.0 h1:ZccBD62Yh4uJng6ODCEYz3GzYoaWTNUyxrlDqlkHSO8= -github.com/roadrunner-server/resetter/v2 v2.8.0/go.mod h1:UceaCOM2aZENEY3+d2YAwhfyl+6kKCkQ3snYC7DoyN4= -github.com/roadrunner-server/rpc/v2 v2.8.0 h1:usQR9hz1S1XI3sYCeJfXMCUx4LtH+Ccd4YqiBVZVW08= -github.com/roadrunner-server/rpc/v2 v2.8.0/go.mod h1:URe3Ibkj313pik23Ld1rZnhllO/p5BTzxcrTgNGyi/o= -github.com/roadrunner-server/sdk/v2 v2.8.0 h1:zJWptw5wt8YTi/Zmn2sEElx2a5IdwnkR+F4o3j1Y4r8= -github.com/roadrunner-server/sdk/v2 v2.8.0/go.mod h1:oqohHdPseV3P3woXk3H1XUnU8YeprC63O8wRmjCkP5Q= -github.com/roadrunner-server/server/v2 v2.8.0 h1:/UyyJ5biawoKHnbyV79GPxlzCXVzfgC5OYnuT51p3E8= -github.com/roadrunner-server/server/v2 v2.8.0/go.mod h1:U49kxlJ2mU8+pNdnN7NbvY0pprctlHKKUitAjNVTuWg= +github.com/roadrunner-server/informer/v2 v2.9.0 h1:u0BAyiPftbsyNKqF6zSa1FDvknYCU0JyWTH0yK3aWYk= +github.com/roadrunner-server/informer/v2 v2.9.0/go.mod h1:byiaGs6+/+/wWt31VPuoh3zGKbpcs/IPEQAJac8ax0o= +github.com/roadrunner-server/logger/v2 v2.9.0 h1:D7Z8/qY0G3RcSyLyrpsf8KkAWwErUzEUhEG7F7207Yo= +github.com/roadrunner-server/logger/v2 v2.9.0/go.mod h1:ITc1amFW7b5fW8CakJ7Q3sQKBIc/jtD7CDH/N+/1vW4= +github.com/roadrunner-server/resetter/v2 v2.9.0 h1:8evoktKLNjYArUfrPb73MfAWI3cTLRue5DV7LLUJrGM= +github.com/roadrunner-server/resetter/v2 v2.9.0/go.mod h1:bYbl+n3Eyc4F6uXa4hEpRe6nTiNd+xw6/2GzixM4fe0= +github.com/roadrunner-server/rpc/v2 v2.9.0 h1:naBzNz3eLgCeWN25WF6Iqr4eYfv1daWwk7EjVe8thlg= +github.com/roadrunner-server/rpc/v2 v2.9.0/go.mod h1:zu84JUn3ssSQ26sKZ51ehSvZFupG4p+DhcftMhS2Ae0= +github.com/roadrunner-server/sdk/v2 v2.9.1 h1:TOIOLCWQ5kenQgg3XnFqgCXnTsHrPqO/kp9RgIWW/wI= +github.com/roadrunner-server/sdk/v2 v2.9.1/go.mod h1:rDLsNXHdpbPGkHIVA7JoLEIHlFc6ydCwOsOpGdfuYfI= +github.com/roadrunner-server/server/v2 v2.9.2 h1:cc83Icc2XDdB0sNAVQcoI2pwtjnSFjPXzIV+ZZsRX0o= +github.com/roadrunner-server/server/v2 v2.9.2/go.mod h1:wpokWo01sZGIRvqvBlQgRxNG/jvR3gSbgu8jhGZWSAg= github.com/roadrunner-server/tcplisten v1.1.1 h1:uVJVdg/zaasD2A4Mg+GyMlsUy2nLp9ADKec/REzql9Y= github.com/roadrunner-server/tcplisten v1.1.1/go.mod h1:2MjzsggdgxCca4p2k3YJdWdo/QnQehiOTy0knlE226c= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= @@ -436,6 +439,9 @@ github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg= github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/uber-go/tally/v4 v4.1.1 h1:jhy6WOZp4nHyCqeV43x3Wz370LXUGBhgW2JmzOIHCWI= github.com/uber-go/tally/v4 v4.1.1/go.mod h1:aXeSTDMl4tNosyf6rdU8jlgScHyjEGGtfJ/uwCIf/vM= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.33.0/go.mod h1:KJRK/MXx0J+yd0c5hlR+s1tIHD72sniU8ZJjl97LIw4= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= @@ -494,6 +500,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -574,7 +581,9 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211109214657-ef0fda0de508/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -683,9 +692,9 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211209171907-798191bca915/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/internal/codec/proto/proto.go b/internal/codec/proto/proto.go index 6bd38217..76323f1c 100644 --- a/internal/codec/proto/proto.go +++ b/internal/codec/proto/proto.go @@ -8,9 +8,9 @@ import ( "github.com/fatih/color" "github.com/goccy/go-json" "github.com/google/uuid" + "github.com/roadrunner-server/api/v2/payload" + "github.com/roadrunner-server/api/v2/pool" "github.com/roadrunner-server/errors" - "github.com/roadrunner-server/sdk/v2/payload" - "github.com/roadrunner-server/sdk/v2/pool" "github.com/roadrunner-server/sdk/v2/utils" "github.com/temporalio/roadrunner-temporal/internal" _codec "github.com/temporalio/roadrunner-temporal/internal/codec" diff --git a/plugin.go b/plugin.go index ccae0e22..a61732eb 100644 --- a/plugin.go +++ b/plugin.go @@ -9,9 +9,11 @@ import ( "github.com/roadrunner-server/api/v2/plugins/config" "github.com/roadrunner-server/api/v2/plugins/server" + rrPool "github.com/roadrunner-server/api/v2/pool" + "github.com/roadrunner-server/api/v2/state/process" "github.com/roadrunner-server/errors" - rrPool "github.com/roadrunner-server/sdk/v2/pool" - "github.com/roadrunner-server/sdk/v2/state/process" + poolImpl "github.com/roadrunner-server/sdk/v2/pool" + processImpl "github.com/roadrunner-server/sdk/v2/state/process" "github.com/temporalio/roadrunner-temporal/activity" "github.com/temporalio/roadrunner-temporal/internal" "github.com/temporalio/roadrunner-temporal/internal/codec/proto" @@ -128,7 +130,7 @@ func (p *Plugin) Serve() chan error { p.log.Info("connected to temporal server", zap.String("address", p.config.Address)) // ------ ACTIVITIES POOL -------- - pl, err := p.server.NewWorkerPool(context.Background(), p.config.Activities, env) + pl, err := p.server.NewWorkerPool(context.Background(), p.config.Activities, env, nil) if err != nil { errCh <- errors.E(op, err) return errCh @@ -146,7 +148,7 @@ func (p *Plugin) Serve() chan error { // ---------- WORKFLOWS ------------- wpl, err := p.server.NewWorkerPool( context.Background(), - &rrPool.Config{ + &poolImpl.Config{ NumWorkers: 1, AllocateTimeout: time.Hour * 240, DestroyTimeout: time.Second * 30, @@ -154,6 +156,7 @@ func (p *Plugin) Serve() chan error { Supervisor: nil, }, env, + nil, ) if err != nil { errCh <- err @@ -230,7 +233,7 @@ func (p *Plugin) Workers() []*process.State { states := make([]*process.State, 0, len(wfPw)+len(actPw)) for i := 0; i < len(wfPw); i++ { - st, err := process.WorkerProcessState(wfPw[i]) + st, err := processImpl.WorkerProcessState(wfPw[i]) if err != nil { // log error and continue p.log.Error("worker process state error", zap.Error(err)) @@ -241,7 +244,7 @@ func (p *Plugin) Workers() []*process.State { } for i := 0; i < len(actPw); i++ { - st, err := process.WorkerProcessState(actPw[i]) + st, err := processImpl.WorkerProcessState(actPw[i]) if err != nil { // log error and continue p.log.Error("worker process state error", zap.Error(err)) diff --git a/tests/disaster_test.go b/tests/disaster_test.go index 5909dae2..77c079fb 100644 --- a/tests/disaster_test.go +++ b/tests/disaster_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" + "github.com/roadrunner-server/api/v2/state/process" goridgeRpc "github.com/roadrunner-server/goridge/v3/pkg/rpc" - "github.com/roadrunner-server/sdk/v2/state/process" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.temporal.io/sdk/client"