Skip to content

Commit e56d9c1

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

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-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

+10-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,17 @@ impl SubgraphIntrospection {
5050
.skip(1)
5151
.filter_map(|change| async move {
5252
match change {
53-
Ok(subgraph) => Some(subgraph),
53+
Ok(subgraph) => {
54+
eprintln!(
55+
"Connectivity restored for subgraph \"{}\".\n",
56+
subgraph.name()
57+
);
58+
Some(subgraph)
59+
}
5460
Err(err) => {
61+
eprintln!("Error detected communicating with subgraph: {}", err);
62+
eprintln!("Note: Schema changes will not be reflected.");
63+
eprintln!("Will retry but subgraph logs should be inspected.\n\n");
5564
tracing::error!("{:?}", err);
5665
None
5766
}

0 commit comments

Comments
 (0)