Cancel resolver tasks if execution of an operation is terminated
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia tracciando l’esecuzione delle operazioni GraphQL asincrone e il modo in cui vengono pianificate le attività dei resolver quando un resolver non nullable fallisce. Riproduci lo scenario Strawberry descritto nell’issue #3414; il lavoro è completato quando le attività dei resolver non più necessarie vengono annullate prima del termine dell’esecuzione e non continuano dopo la risposta o la pulizia del ciclo di vita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 531
- Fork
- 147
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphql-python/graphql-core
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 50/100
graphql-python/graphql-core#272 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
graphql-python/graphql-core#269 · 1 commento ·
-
Publish a major version Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
graphql-python/graphql-core#267 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
graphql-python/graphql-core#257 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
graphql-python/graphql-core#247 · 8 commenti ·
Tutte le issue di graphql-python/graphql-core
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/skills#1811 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
speaches-ai/speaches#678 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
datalayer/mcp-compose#42 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
UKGovernmentBEIS/inspect_evals#2523 ·