Skip to content

Commit 559140d

Browse files
committed
[BGS-144] Introspection watcher should notify when subgraph hosts change connection status.
1 parent 9b1b706 commit 559140d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/composition/supergraph/config/error/subgraph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub enum ResolveSubgraphError {
2626
#[error(transparent)]
2727
Fs(Box<dyn std::error::Error + Send + Sync>),
2828
/// Occurs when a introspection against a subgraph fails
29-
#[error("Failed to introspect the subgraph {subgraph_name}.")]
29+
#[error("Failed to introspect the subgraph \"{subgraph_name}\".")]
3030
IntrospectionError {
3131
/// The subgraph name that failed to be resolved
3232
subgraph_name: String,

src/composition/watchers/subgraphs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl SubtaskHandleStream for SubgraphWatchers {
170170
match diff {
171171
Ok(diff) => {
172172
// If we detect additional diffs, start a new subgraph subtask.
173-
// Adding the abort handle to the currentl collection of handles.
173+
// Adding the abort handle to the current collection of handles.
174174
for (subgraph_name, subgraph_config) in diff.added() {
175175
let _ = subgraph_handles.add(
176176
subgraph_name,

src/composition/watchers/watcher/introspection.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@ impl SubgraphIntrospection {
5050
.skip(1)
5151
.filter_map(|change| async move {
5252
match change {
53-
Ok(subgraph) => Some(subgraph),
53+
Ok(subgraph) => {
54+
println!("Connectivity restored for subgraph \"{}\".\n", subgraph.name());
55+
Some(subgraph)
56+
},
5457
Err(err) => {
58+
println!("Error detected communicating with subgraph: {}", err);
59+
println!("Note: Schema changes will not be reflected.");
60+
println!("Will retry but subgraph logs should be inspected.\n\n");
5561
tracing::error!("{:?}", err);
5662
None
5763
}

0 commit comments

Comments
 (0)