-
Notifications
You must be signed in to change notification settings - Fork 272
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
Schema update is not propagated to the HTTP server #41
Comments
I see three ways to fix that:
I'm partial to the second solution, since I have exhaustively explored that particular rabbit hole. Managing the listen socket outside of warp will be useful when we start putting bounds on the number of sessions and rate limiting new connections. |
alternate version for option 2:
with this method we do not need to introduce another queue, but we will need to reimplement the graceful shutdown |
Just bear in mind that it's not restarting the server that is costly. It's draining the requests. That's why we were using shared state before. We would not want to drain the requests to update schema. |
draining the requests was costly because some of them were staying there for a long time, right? Or was there another reason? What was the cost? Memory usage? |
Draining requests is costly due to timeouts. During this time we cannot serve new requests right? |
as said in the call earlier, with #5 we can accept new connections using the new schema right away, we don't need to wait for previous connections to be drained |
Describe the bug
maybe I'm missing something, but it looks like
UpdateSchema
messages change the schema in the state machine: https://github.com/apollographql/router/blob/07dfdddedc3e90cf6a7e0124ceb9f1a23446cae6/crates/apollo-router/src/state_machine.rs#L150-L172but does not pass it to the HTTP server. It is only changed here: https://github.com/apollographql/router/blob/07dfdddedc3e90cf6a7e0124ceb9f1a23446cae6/crates/apollo-router/src/state_machine.rs#L193-L196
To Reproduce
At this line: https://github.com/apollographql/router/blob/07dfdddedc3e90cf6a7e0124ceb9f1a23446cae6/crates/apollo-router/src/lib.rs#L579
add the following:
This will first set up a server with the configuration and an empty schema, then try to update the schema. Any query to the router will fail because the schema used is still the empty one
The text was updated successfully, but these errors were encountered: