cube-js / cube

📊 Cube — The Semantic Layer for Building Data Applications
https://cube.dev
Other
17.93k stars 1.78k forks source link

Continue wait for GraphQL responses with http status code 500. #6651

Open nitzien opened 1 year ago

nitzien commented 1 year ago

Describe the bug Continue wait error for GraphQL responses with http status code 500.

To Reproduce Steps to reproduce the behavior:

  1. Make a graphql query which would take more than 5 seconds (or reduce continueWait time configuration).

Expected behavior Though, we don't have this documented for graphql. for rest api it is documented to return with 200. Can we please have same http status code for graphql also. https://cube.dev/docs/http-api/rest/#prerequisites-continue-wait

Additional context From Slack thread- https://cube-js.slack.com/archives/C04NYBJP7RQ/p1684846190185819

@vasilev-alex

igorlukanin commented 10 months ago

It looks like this behavior is caused by the express-graphql library that is used by Cube to implement the GraphQL API: https://github.com/cube-js/cube/blob/b8de472b054f513732671e2211c4b2df1f811e99/packages/cubejs-api-gateway/src/gateway.ts#L230-L239

Unfortunately, this library is not maintained anymore. Probably, it should be replaced with a similar library first.

github-actions[bot] commented 10 months ago

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

igorlukanin commented 10 months ago

As a non-ideal workaround, I may suggest updating orchestrator_options (https://cube.dev/docs/reference/configuration/config#orchestrator_options) with a bigger continueWaitTimeout or, preferably, using pre-aggregations to speed up queries and eliminate "continue waits" completely.