Improve refund policy#84
Merged
Merged
Conversation
1dec2d1 to
4bfc211
Compare
There was a problem hiding this comment.
Pull request overview
This PR separates “task deadline/timeout” from “in-memory result retention” by introducing a distinct taskmanager_task_lifetime alongside the existing taskmanager_result_lifetime, and wires these through config, DB settings, and the TaskManager so runtime settings can adjust them independently.
Changes:
- Added task-vs-result lifetimes to config + DB
app_settings, with new defaults (task: 10m, results: 5m). - Updated
TaskManagerto track task/result lifetimes separately and allow updating them at runtime. - Updated task deadline calculation for DB generation tasks to use task lifetime (not result lifetime) and adjusted tests/harnesses accordingly.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/event_tracker/worker.rs | Updates test harness options to set task lifetime for timeout behavior. |
| tests/event_tracker/support.rs | Extends runtime settings updates to include task/result lifetime columns. |
| tests/common/real_harness.rs | Adds task lifetime option + seeds new lifetime columns into app_settings. |
| tests/client_http_api/support.rs | Includes new lifetime fields when updating gateway runtime settings. |
| tests/client_http_api/generic_rate_limits.rs | Switches end-to-end timeout behavior to task lifetime. |
| src/test_support.rs | Passes task_lifetime into TaskManagerInit when building shared harness core. |
| src/task/tests.rs | Adds coverage for lifetime updates + updates struct literals for new init field. |
| src/task/mod.rs | Implements separate task/result lifetimes (atomics) + runtime update API. |
| src/raft/tests/cross_gateway_add_task.rs | Passes configured task lifetime into TaskManagerInit in raft tests. |
| src/raft/rate_limit/engine.rs | Constructs TaskManager with explicit task lifetime in tests. |
| src/raft/mod.rs | Reorders settings updater spawn to provide TaskManager for runtime lifetime updates. |
| src/raft/gateway_state.rs | Exposes task/result lifetime accessors from DB settings or config fallback. |
| src/http3/handlers/task/add_task.rs | Uses task lifetime for generation-task DB deadline calculation. |
| src/db/gateway_settings.rs | Adds lifetime fields to cached settings + pushes runtime updates into TaskManager. |
| src/db/data_access.rs | Adds new app_settings columns to gateway settings row decode + SELECT. |
| src/config.rs | Adds taskmanager_task_lifetime with defaults; adds default for result lifetime. |
| dev-env/init-scripts/init-schema.sql | Adds app_settings columns + defaults and seeds initial row values. |
| dev-env/config/config1.toml | Updates dev config to use new lifetime split and defaults. |
| dev-env/config/config2.toml | Updates dev config to use new lifetime split and defaults. |
| dev-env/config/config3.toml | Updates dev config to use new lifetime split and defaults. |
| dev-env/config/config-single.toml | Updates dev config to use new lifetime split and defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4bfc211 to
c23b669
Compare
the-mx
approved these changes
May 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.