Cancel resolver tasks if execution of an operation is terminated
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza siguiendo la ejecución de operaciones GraphQL asíncronas y cómo se programan las tareas de los resolvers cuando falla un resolver no anulable. Reproduce el escenario de Strawberry descrito en el issue #3414; se considera completado cuando las tareas de los resolvers que ya no son necesarias se cancelan antes de que termine la ejecución y no continúan después de la respuesta o de la limpieza del ciclo de vida.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
TL;DR
Would it be possible to cancel outstanding resolver tasks as soon as before execution of a GraphQL operation is terminated? Outstanding / unused tasks can happen as a result of an incoercible field resolver error.
These outstanding tasks can run well after lifecycle hooks responsible for cleaning up their context have completed. As a result, they often fail and cause a lot of noisy errors for us.
More details
Hello!
I'm coming from the strawberry-graphql project. We're running into a problem with abandoned resolver tasks not being cancelled, and thus failing in unpredictable ways.
Strawberry has an extensions framework which allows you to wrap the execution phase of your operation processing in hooks – running code before and after execution of resolvers. We use these hooks to manage (set up and tear down) some state needed by the resolvers.
However, when a resolver of a non-nullable field fails, it may lead to the results of some other resolvers being no longer necessary. It appears that graphql-core will then short-circuit returning a result, while the no-longer-necessary resolvers are still running. We see that they can continue running well after the HTTP response was returned.
The problem is that Strawberry's lifecycle hooks (and I also imagine - the webserver's) would have completed by that time. As a result, we do things like terminate the DB session – making it very likely that these outstanding tasks will fail with various esoteric errors. This causes a lot of noise in our observability suite – which we'd love to avoid.
See https://github.com/strawberry-graphql/strawberry/issues/3414 for more details, and https://github.com/strawberry-graphql/strawberry/issues/3414#issuecomment-2012060461 for the comment which recommends I report the issue here.
- Lenguaje dominante
- Python
- Estrellas
- 531
- Forks
- 147
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de graphql-python/graphql-core
-
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
graphql-python/graphql-core#272 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
graphql-python/graphql-core#269 · 1 comentario ·
-
Publish a major version Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
graphql-python/graphql-core#267 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
graphql-python/graphql-core#257 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
graphql-python/graphql-core#247 · 8 comentarios ·
Todos los issues de graphql-python/graphql-core
Issues similares
-
essnmx good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
[Feature] 奇物选择添加优先级 Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
syfoud/Simulated_Scepter#174 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Giskard-AI/giskard-oss#2840 · 1 comentario ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Abiertoarea: repo bug perceived difficulty: 2
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
yeti-platform/yeti#1380 ·