apollographql / rover

The CLI for Apollo GraphOS
https://rover.apollo.dev
Other
408 stars 85 forks source link

Intermittent introspection query errors in rover dev #1868

Open dandersonhall opened 8 months ago

dandersonhall commented 8 months ago

Description

Using rover dev and getting regular error messages like error[E004]: error sending request for url (http://localhost:4001/): connection error: Connection reset by peer (os error 54) and error[E004]: error sending request for url (http://localhost:4002/): connection closed before message completed

This causes the router instance to stop and not restart until the next introspection query.

Steps to reproduce

Run rover dev --supergraph-config supergraph.yaml --polling-interval=5 where supergraph.yaml looks like

subgraphs:
  subgraph1:
    routing_url: http://localhost:4001/
    schema:
      subgraph_url: http://localhost:4001/
  subgraph2:
    routing_url: http://localhost:4002/
    schema:
      subgraph_url: http://localhost:4002/

Expected result

Rover dev should handle the errors (or at least retry) before removing the subgraph from the session. Investigationg have shown that the subgraph is sending a connection reset message to rover but this causes rover to fail the subgraph straight away even though the next request would succeed.

Environment

Version: 0.22.0 Install Location: /Users//.rover/bin/rover OS: Mac OS 14.2.1 [64-bit] Shell: /bin/zsh

jonathanrainer commented 4 months ago

Hi @dandersonhall, apologies for the length of time taken to reply. We have a PR open that I believe would fix this issue, is there any chance you could have a go building Rover and trying it out in your specific situation? No guarantees obviously but it would be good to know if it helps :)

PR in question: https://github.com/apollographql/rover/pull/1936