Repository navigation
Priority band for the pending set, enqueued_at instrumentation, and a retryable-starvation fix #13
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
8 commits
Select commit
Hold shift + click to select a range
7bad082
CI: run the test matrix on ubuntu-22.04
rstojano 1fb42eb
CI: install sqlite3 as a precompiled gem so the Ruby 2.7 matrix builds
rstojano 36ae319
CI: run the redis-client specs against the production app hybrid
rstojano b7779fc
Add a priority band to the pending set, and stamp enqueued_at
Kosmin a6a8037
Stop a deep retryable set from starving the pending set
Kosmin cef9664
Floor pending's budget at one slot, and claim due retries atomically
Kosmin e32fdfc
Cap retryable instead of reserving for it, so a drain gets the whole …
Kosmin 5c01566
Drop a comment block that describes the claim this branch replaced
Kosmin 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ env: | |
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-20.04 | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| services: | ||
| postgres: | ||
|
|
||
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
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
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,36 @@ | ||
| # Production runs a hybrid store: apps live in Redis — where Notification#app resolves them and | ||
| # the notification store is keyed — AND in ActiveRecord, where the daemon reads them | ||
| # (Store::Redis#all_apps / #app use Rpush::Client::ActiveRecord::App; see the "Use ActiveRecord | ||
| # to fetch Apps instead of Redis" change). The upstream specs only create Redis apps, so under | ||
| # the redis client the daemon can't find them. Mirror every Redis app into ActiveRecord under | ||
| # the same id so both sides agree, exactly as production keeps them in sync. Test-only. | ||
| module RedisAppMirror | ||
| module_function | ||
|
|
||
| def active_record_class_for(redis_app) | ||
| redis_app.class.name.sub('Rpush::Client::Redis', 'Rpush::Client::ActiveRecord').constantize | ||
| end | ||
|
|
||
| def mirror(redis_app) | ||
| ar_class = active_record_class_for(redis_app) | ||
| record = ar_class.find_or_initialize_by(id: redis_app.id) | ||
| copyable = redis_app.attributes.slice(*ar_class.column_names).except('id', 'type') | ||
| record.assign_attributes(copyable) | ||
| record.id = redis_app.id | ||
| record.save!(validate: false) | ||
| end | ||
|
|
||
| def remove(id) | ||
| Rpush::Client::ActiveRecord::App.where(id: id).delete_all | ||
| end | ||
| end | ||
|
|
||
| Rpush::Client::Redis::App.class_eval do | ||
| after_save { RedisAppMirror.mirror(self) } | ||
| after_destroy { RedisAppMirror.remove(id) } | ||
| end | ||
|
|
||
| # The redis Feedback model disables Modis' all-index in production to avoid a huge "all" set. | ||
| # Re-enable it for the test suite so specs can list feedback via .all; the data volumes that | ||
| # motivate disabling it in production do not exist in tests. | ||
| Rpush::Client::Redis::Apns::Feedback.enable_all_index(true) |
Oops, something went wrong.
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.