Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start receiving from queue only once we got all inflight executions. #269

Merged
merged 5 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.6.2
11.6.3
2 changes: 1 addition & 1 deletion mettle/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,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 {
Expand All @@ -177,6 +176,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)
Expand Down
Loading