-
Notifications
You must be signed in to change notification settings - Fork 244
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
hot-reload not working with k3d filesystem on macOS (M1): "Bad file descriptor" #1476
Comments
I'm going to rename the issue, because the problem is caused by the filesystem your are running in k3d. Reload works fine on OS X on bare metal or docker. |
I've verified this. Not sure what the fix is right now. |
workaround: don't specify |
I have confirmed this issue is also impacting me on an M1 Macbook using Docker Desktop. |
Using the command: docker run --rm -it \
-p 8085:8085 \
-v $(pwd)/schema.graphql:/dist/config/schema.graphql \
-v $(pwd)/router.yaml:/dist/config/router.yaml \
api-router If I then update my Docker image to include the
|
Additionally running the macOS binary directly is successful:
|
This looks to be a known problem with the hotwatch library being used, a wrapper for the notify library. All recommendations say to switch to PollWatcher. Doing this switch might also fix issue #1695 for watching files it does not own. |
fixes: #1476 fixes: #1695 The change replaces `hotwatch` with `notify` and makes use of the "recommended" watcher feature which attempts to pick a file watcher which is best suited to the execution environment. I've also improved the robustness of the test and the way in which events are conveyed from the file watcher to the consumer (retries on full to prevent lost event notifications). I've tested this manually on my local system (Macos M1) and confirmed: - test suite works - docker with --hot-reload works - kubernetes in k3d works* * Note: [Limitations in kubernetes configmap handling](https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically) mean that router pods in kubernetes won't react to changes to configmaps mounted to containers which specify a subPath (which the router helm chart currently does). Changes to schema will trigger a hot-reload. As a drive-by: I've made a slight modification to the helm chart which removes the use of subPath. If we don't specify the subPath and mount the chart at /app/ we get the same result but with the added benefit of configMap updates by k8s.
I think this is related but happy to open a new issue. On version 1.3.0 I'm unable to run the following command. APOLLO_ROUTER_HOT_RELOAD=true causes it to panic and APOLLO_ROUTER_HOT_RELOAD=false will allow it to run.
|
Describe the bug
Hot-reload is not working on MacOS (M1). The router is unable to start.
Tested the same setup on Ubuntu and seems to work without any issue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The router should works as expected.
Output
Desktop (please complete the following information):
Additional context
Maybe this is related: notify-rs/notify#282
Additional question
Is there a way to manually reload the supergraph schema without restart?
The text was updated successfully, but these errors were encountered: