Skip to content

Commit

Permalink
handle readiness errors for deduplicated queries too
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Nov 13, 2024
1 parent 0f9d856 commit db89fcc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apollo-router/src/query_planner/caching_query_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,19 @@ where
// of restarting the query planner until another timeout
tokio::task::spawn(
async move {
let res = self.delegate.ready().await?.call(request).await;
let service = match self.delegate.ready().await {
Ok(service) => service,
Err(error) => {
let e = Arc::new(error);
let err = e.clone();
tokio::spawn(async move {
entry.insert(Err(err)).await;
});
return Err(CacheResolverError::RetrievalError(e));
}
};

let res = service.call(request).await;

match res {
Ok(QueryPlannerResponse {
Expand Down

0 comments on commit db89fcc

Please sign in to comment.