-
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
base: main
Are you sure you want to change the base?
Changes from 18 commits
74f4283
505dd34
17d2853
42ec510
541f998
e147a33
8a54b57
c18b1c3
a38a733
8d4d2c1
647c8c6
ef7300e
0f9b01e
0f2c88a
6602155
fbec585
18de8ce
dda0978
1da6569
5797f34
967fbb2
965ddde
0fb7484
b249e93
7a15ead
fcacdb7
e547ed8
fca1aa9
7489919
f63509c
40c27f0
8f852f7
237a3e4
e3daccf
ce48ba7
d05da9c
24908e6
9ae8038
22f32d6
1cb1e24
7a5f42a
ac63b56
7d15c8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # yaml-language-server: $schema=../../router-config.schema.json | ||
| supergraph: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we have inlined confings instead?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think those are not even used
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. They are not used, removed! |
||
| source: file | ||
| path: ../supergraph.graphql | ||
| traffic_shaping: | ||
| all: | ||
| circuit_breaker: | ||
| enabled: true | ||
| error_threshold: 0.5 | ||
| volume_threshold: 5 | ||
| reset_timeout: 30s | ||
| # Disable deduplication to better test circuit breaker behavior | ||
| dedupe_enabled: false | ||
| 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: 0.5 | ||
| 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 |
| 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: 0.6 | ||
| volume_threshold: 3 | ||
| reset_timeout: 10s | ||
| products: | ||
| circuit_breaker: | ||
| enabled: true | ||
| error_threshold: 0.7 | ||
| volume_threshold: 4 | ||
| reset_timeout: 15s |
Uh oh!
There was an error while loading. Please reload this page.