diff --git a/ChangeLog b/ChangeLog index 0218e592..6ef67f8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Version 11.6.3 +-------------- + * Start receiving from queue only once we got all inflight executions. + This should fix a potential data race on init. + Version 11.6.2 -------------- * Error token bucket was mistakenly consuming with `Allow()`. Refactored to make token bucket behaviour correct. diff --git a/VERSION b/VERSION index 48f8d64e..546fe235 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -11.6.2 +11.6.3 diff --git a/mettle/api/api.go b/mettle/api/api.go index cf75673d..1c480021 100644 --- a/mettle/api/api.go +++ b/mettle/api/api.go @@ -169,7 +169,6 @@ func serve(opts grpcutil.Opts, name string, queueOpts PubSubOpts, apiURL string, log.Notice(" %s: %s", k, strings.Join(v, ", ")) } - go srv.Receive() if jobs, err := getExecutions(opts, apiURL, connTLS); err != nil { log.Warningf("Failed to get inflight executions: %s", err) } else if len(jobs) > 0 { @@ -180,6 +179,7 @@ func serve(opts grpcutil.Opts, name string, queueOpts PubSubOpts, apiURL string, go srv.expireJob(id) } } + go srv.Receive() lis, s := grpcutil.NewServer(opts) pb.RegisterCapabilitiesServer(s, srv)