-
Notifications
You must be signed in to change notification settings - Fork 10
Circuit Breakers on Subgraph Execution #900
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
Open
ardatan
wants to merge
49
commits into
main
Choose a base branch
from
circuit-breaker-subgraph
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,678
−111
Open
Changes from 31 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
74f4283
Circuit Breakers on Subgraph Execution
ardatan 505dd34
docs: update documentation
theguild-bot 17d2853
fixes
ardatan 42ec510
docs: update documentation
theguild-bot 541f998
Update lib/executor/src/executors/map.rs
ardatan e147a33
..
ardatan 8a54b57
.
ardatan c18b1c3
docs: update documentation
theguild-bot a38a733
Changeset
ardatan 8d4d2c1
..
ardatan 647c8c6
Update lib/router-config/src/traffic_shaping.rs
ardatan ef7300e
Update lib/executor/Cargo.toml
ardatan 0f9b01e
docs: update documentation
theguild-bot 0f2c88a
Update docs/README.md
ardatan 6602155
Address
ardatan fbec585
addressed
ardatan 18de8ce
docs: update documentation
theguild-bot dda0978
Go
ardatan 1da6569
..
ardatan 5797f34
docs: update documentation
theguild-bot 967fbb2
Fix typo
ardatan 965ddde
docs: update documentation
theguild-bot 0fb7484
Improvements
ardatan b249e93
Merge origin/main into circuit-breaker-subgraph: resolve conflicts in…
Copilot 7a15ead
docs: regenerate README from merged schema
Copilot fcacdb7
Merge main into circuit-breaker-subgraph and resolve conflicts
Copilot e547ed8
Merge branch 'main' into circuit-breaker-subgraph
ardatan fca1aa9
Merge origin/main into circuit-breaker-subgraph: resolve conflicts
Copilot 7489919
Address Devin comment
ardatan f63509c
docs: update documentation
theguild-bot 40c27f0
fix: clone circuit breaker before await to avoid DashMap lock held ac…
Copilot 8f852f7
..
ardatan 237a3e4
5XX as errors tests
ardatan e3daccf
More
ardatan ce48ba7
docs: update documentation
theguild-bot d05da9c
Update JSON schema
ardatan 24908e6
docs: update documentation
theguild-bot 9ae8038
Lets go
ardatan 22f32d6
Merge branch 'main' into circuit-breaker-subgraph
ardatan 1cb1e24
docs: update documentation
theguild-bot 7a5f42a
Reorder percentage module in mod.rs
ardatan ac63b56
Merge branch 'main' into circuit-breaker-subgraph
ardatan 7d15c8f
Merge branch 'main' into circuit-breaker-subgraph
ardatan 7458b74
More
ardatan f10bcc7
5xx
ardatan de18b34
Merge branch 'main' into circuit-breaker-subgraph
ardatan 589848a
Merge branch 'main' into circuit-breaker-subgraph
ardatan fa1714e
Half-open
ardatan dc56559
fix: update inaccurate comments in error.rs and circuit_breaker.rs
Copilot 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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| hive-router: patch | ||
| hive-router-plan-executor: patch | ||
| hive-router-config: patch | ||
| --- | ||
|
|
||
| # Implement Circuit Breaker for Subgraph Requests | ||
|
|
||
| This change introduces a circuit breaker mechanism for subgraph requests in the Hive Router. The circuit breaker will monitor the success and failure rates of requests to each subgraph and will prevent future requests if the failure rate exceeds a certain threshold. When the circuit breaker is opened, subsequent requests to that subgraph will fail immediately without attempting to send the request. | ||
|
|
||
| This implementation helps improve the resilience and stability of the Hive Router when dealing with unreliable subgraphs. |
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
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,13 @@ | ||
| # yaml-language-server: $schema=../../router-config.schema.json | ||
| supergraph: | ||
| source: file | ||
| path: ../supergraph.graphql | ||
| traffic_shaping: | ||
| all: | ||
| circuit_breaker: | ||
| enabled: true | ||
| error_threshold: 50% | ||
| volume_threshold: 5 | ||
| reset_timeout: 30s | ||
| # Disable deduplication to better test circuit breaker behavior | ||
| dedupe_enabled: false | ||
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,18 @@ | ||
| # yaml-language-server: $schema=../../router-config.schema.json | ||
| supergraph: | ||
| source: file | ||
| path: ../supergraph.graphql | ||
| traffic_shaping: | ||
| all: | ||
| circuit_breaker: | ||
| enabled: true | ||
| error_threshold: 50% | ||
| volume_threshold: 10 | ||
| reset_timeout: 30s | ||
| dedupe_enabled: false | ||
| subgraphs: | ||
| accounts: | ||
| circuit_breaker: | ||
| enabled: true | ||
| volume_threshold: 3 # Override only volume_threshold | ||
| # error_threshold and reset_timeout inherit from global |
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,22 @@ | ||
| # yaml-language-server: $schema=../../router-config.schema.json | ||
| supergraph: | ||
| source: file | ||
| path: ../supergraph.graphql | ||
| traffic_shaping: | ||
| all: | ||
| circuit_breaker: | ||
| enabled: false # Disabled globally | ||
| dedupe_enabled: false | ||
| subgraphs: | ||
| accounts: | ||
| circuit_breaker: | ||
| enabled: true | ||
| error_threshold: 60% | ||
| volume_threshold: 3 | ||
| reset_timeout: 10s | ||
| products: | ||
| circuit_breaker: | ||
| enabled: true | ||
| error_threshold: 70% | ||
| volume_threshold: 4 | ||
| reset_timeout: 15s |
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.