Description
Expected Behavior
Dockerised app using async-graphql app does not freeze requests when dockerised with github actions
Actual Behavior
Requests are frozen when async-graphql app is dockerise with github actions
Steps to Reproduce the Problem
- Run
docker run -p 9091:8000 andreievg/checking-async-graphql:with-7.0.16
- Run
curl -X POST http://127.0.0.1:9091/graphql -H 'Content-Type: application/json' -d '{ "query": "query { user(id: 1) {__typename id name } }" }'
- Run again
curl -X POST http://127.0.0.1:9091/graphql -H 'Content-Type: application/json' -d '{ "query": "query { user(id: 1) {__typename id name } }" }'
- See freeze
Docker image built from simple example with one loader, with this github action, and this dockerfile , the dockerfile has extra stuff (sorry I copy pasted to try replicate in haste, I did previously tried without faketime, still freezes)
(I am also using --platform linux/amd64
to start docker, on m3 mac, but i was also getting freezes when running on x86-64 and amd65)
Specifications
- Version:
- Platform:
- Subsystem:
Suggested solutions
I tried with my fork, replacing futures_channel::Delay with tokio::sleep and the problem went away, with this change in test repo, built docker image and launched with this.
docker run --platform linux/amd64 -p 9091:8000 andreievg/checking-async-graphql:tokio-sleep
I am happy to make PR, need some guidance:
1 - Replace as per commit
2 - Another feature dataloader-tokio-sleep ¯_(ツ)_/¯
3 - Investigate further, sorry don't have time for this, it's not clear what in the docker build in github actions is causing it
4 - Deal with our use case only, in github action when dockerising, override dependency with patch from my fork
Extra
I was dockerising our app through github actions and was facing freezing in graphql requests (sometimes they would unfreeze sometime they will block forever). Tried many things (different spawners, actix_rt, async_std, async_std, even extending delay for dataloaders, with no effect. future-rs, even though it's part of rust lang, has a lot of PRs and last release in October 2024, was wondering if it's supported enough ?
You can fork my check repo and try your own docker build, just need to make sure these secrets are added to your forked repo, and change to your dockerhub