Repository navigation
feat(submitqueue): Add queuepause Store contract and QueuePause entity #862
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1395451
feat(submitqueue): Add queuepause Store contract and QueuePauseState …
manjari25 70c83d8
feat(queuepause): Add a free-text Reason to QueuePauseState
manjari25 5d17d82
docs(queuepause): Leave enforcement on a read error to the caller
manjari25 28f88fe
docs(queuepause): Require enforcing callers to fail closed on a read …
manjari25 0b5ce36
refactor(queuepause): Rename QueuePauseState to QueuePause
manjari25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Copyright (c) 2026 Uber Technologies, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package entity | ||
|
|
||
| // QueuePause is a point-in-time snapshot of the pause switches of a single | ||
| // queue. The two switches are independent, and the zero value means the queue | ||
| // is not paused. | ||
| type QueuePause struct { | ||
| // RejectLands is true while the queue refuses new land requests. | ||
| RejectLands bool | ||
|
|
||
| // FreezeProcessing is true while the queue's accepted requests are not advanced. | ||
| FreezeProcessing bool | ||
|
|
||
| // Reason is the operator's free-text explanation for the pause. Empty when none was given. | ||
| Reason string | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| load("@rules_go//go:def.bzl", "go_library") | ||
|
|
||
| go_library( | ||
| name = "go_default_library", | ||
| srcs = ["queuepause.go"], | ||
| importpath = "github.com/uber/submitqueue/submitqueue/extension/queuepause", | ||
| visibility = ["//visibility:public"], | ||
| deps = ["//submitqueue/entity:go_default_library"], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Queue Pause Extension | ||
|
|
||
| Vendor-agnostic source of per-queue pause state. See [the pause and unpause RFC](../../../doc/rfc/submitqueue/queue-pause-and-unpause.md) for the design. | ||
|
|
||
| ## Interfaces | ||
|
|
||
| ### Store | ||
|
|
||
| Returns the pause state of a queue by name. The state is two independent switches: reject new land requests, and freeze processing of accepted requests. A queue with no entry is not paused, and an error means the backend could not be read. | ||
|
|
||
| The store only reports state. The gateway and orchestrator enforce it, so every deployment runs the same rejection and freezing logic and only the source of the state differs. | ||
|
|
||
| ## Entities | ||
|
|
||
| `QueuePause` lives in `submitqueue/entity/queue_pause.go`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| load("@rules_go//go:def.bzl", "go_library") | ||
|
|
||
| go_library( | ||
| name = "go_default_library", | ||
| srcs = ["queuepause_mock.go"], | ||
| importpath = "github.com/uber/submitqueue/submitqueue/extension/queuepause/mock", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "//submitqueue/entity:go_default_library", | ||
| "@org_uber_go_mock//gomock:go_default_library", | ||
| ], | ||
| ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // Copyright (c) 2026 Uber Technologies, Inc. | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| package queuepause | ||
|
|
||
| //go:generate mockgen -source=queuepause.go -destination=mock/queuepause_mock.go -package=mock | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/uber/submitqueue/submitqueue/entity" | ||
| ) | ||
|
|
||
| // Store is the source of per-queue pause state. It reports the switches and | ||
| // decides nothing; enforcement lives in the services that resolve it. | ||
| type Store interface { | ||
| // Get returns the current pause state of a queue. A queue with no entry | ||
| // returns the zero state (not paused) and no error. A non-nil error means | ||
| // the backend could not be read, not that the queue is unpaused; a caller | ||
| // that enforces a switch must not fail open on it. Implementations must be | ||
| // safe for concurrent use. | ||
| Get(ctx context.Context, queue string) (entity.QueuePause, error) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.