Title: broken support for AsyncioExecutor · Issue #32 · graphql-python/graphql-server · GitHub
Open Graph Title: broken support for AsyncioExecutor · Issue #32 · graphql-python/graphql-server
X Title: broken support for AsyncioExecutor · Issue #32 · graphql-python/graphql-server
Description: The #13 PR introduced executors into request processing for batched queries. It also broken support for use of AsyncioExecutor from within asyncio context. When using AsyncioExecutor this line blocks forever: https://github.com/graphql-p...
Open Graph Description: The #13 PR introduced executors into request processing for batched queries. It also broken support for use of AsyncioExecutor from within asyncio context. When using AsyncioExecutor this line bloc...
X Description: The #13 PR introduced executors into request processing for batched queries. It also broken support for use of AsyncioExecutor from within asyncio context. When using AsyncioExecutor this line bloc...
Opengraph URL: https://github.com/graphql-python/graphql-server/issues/32
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"broken support for AsyncioExecutor","articleBody":"The #13 PR introduced executors into request processing for batched queries. It also broken support for use of AsyncioExecutor from within asyncio context.\r\n\r\nWhen using AsyncioExecutor this line blocks forever:\r\n\r\nhttps://github.com/graphql-python/graphql-server-core/blob/427cccb00ae41fb88e8fcaf89aa64f5edb855394/graphql_server/__init__.py#L137\r\n\r\nThe `get()` method is called on Promise that must be `await`ed in async context, here it will stay `pending` forever.\r\n\r\nCall to `wait_until_finished()` on executor does not help because `get_response` is not a coroutine and returns a Promise. Async Promises are not handled by `wait_until_finished()` method of AsyncioExecutor ([code](https://github.com/graphql-python/graphql-core/blob/a600f7c662e7a6db7d6b56e7c67bf43925b6b23d/graphql/execution/executors/asyncio.py#L47)). Even if it was, `AsyncioExecutor.wait_until_finished()` cannot run from within asyncio context and would fail for any asyncio-based application like aiohttp server.\r\n\r\nrelated issue: https://github.com/graphql-python/graphql-core/issues/67\r\n\r\nFix to the above issue introduces a flag `return_promise` which is just what we need to handle response in async context.\r\n\r\nimplementatio details:\r\n\r\nhttps://github.com/graphql-python/graphql-core/commit/b4758b1\r\nhttps://github.com/graphql-python/graphql-core/commit/895b324\r\nhttps://github.com/graphql-python/graphql-core/commit/cea224a\r\n\r\nThis fragment of graphql-core test show hows its intended to be used in asyncio context:\r\n\r\nhttps://github.com/graphql-python/graphql-core/blob/a600f7c662e7a6db7d6b56e7c67bf43925b6b23d/tests_py35/core_execution/test_asyncio_executor.py#L65-L75\r\n\r\nThe `return_promise` lets the main application handle waiting for executors to finish its task, so graphql-server-core should respect that.\r\n\r\nI found this issue in my aiohttp application (using [graphql-python/aiohttp-graphql](https://github.com/graphql-python/aiohttp-graphql)), all queries would block forever. I had to restrict this package version to `\u003c=1.1.1`","author":{"url":"https://github.com/blazewicz","@type":"Person","name":"blazewicz"},"datePublished":"2019-12-21T09:58:03Z","url":"https://github.com/graphql-python/graphql-server/issues/32"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3c1a7134-c5c4-c01b-8662-2982712e23f9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8CC4:1BEF18:11A37D8:1780677:6AFFCD98 |
| html-safe-nonce | 6d1d405aed345a42f2eaa4cfe589d13a9d80cb6cf6eaf8cace34960f860fbe80 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0M0OjFCRUYxODoxMUEzN0Q4OjE3ODA2Nzc6NkFGRkNEOTgiLCJ2aXNpdG9yX2lkIjoiMzk4NzQxNzgzMjMyODUxNDk2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fe7bb433f8636942333e9444a1761970c7ba60d0710265336c73a16c72b4b914 |
| hovercard-subject-tag | issue:541308747 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/graphql-python/graphql-server/32/issue_layout |
| twitter:image | https://opengraph.githubassets.com/885f06b35bc36ecf03fb294face78f97c5272566da9935f1cee6efd302b67309/graphql-python/graphql-server/issues/32 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/885f06b35bc36ecf03fb294face78f97c5272566da9935f1cee6efd302b67309/graphql-python/graphql-server/issues/32 |
| og:image:alt | The #13 PR introduced executors into request processing for batched queries. It also broken support for use of AsyncioExecutor from within asyncio context. When using AsyncioExecutor this line bloc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blazewicz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/graphql-python/graphql-server git https://github.com/graphql-python/graphql-server.git |
| octolytics-dimension-user_id | 15002022 |
| octolytics-dimension-user_login | graphql-python |
| octolytics-dimension-repository_id | 85903189 |
| octolytics-dimension-repository_nwo | graphql-python/graphql-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 85903189 |
| octolytics-dimension-repository_network_root_nwo | graphql-python/graphql-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width