cube-js / cube

📊 Cube — Universal semantic layer platform for AI, BI, spreadsheets, and embedded analytics
https://cube.dev
Other
17.97k stars 1.78k forks source link

continueWaitTimeout is ignored (redis) #225

Closed vieira closed 3 years ago

vieira commented 5 years ago

Describe the bug Even though I defined continueWaitTimeout to be 120 the "Continue wait" response is sent after ~5s (the default).

To Reproduce Steps to reproduce the behavior:

  1. Initialize CubejsServerCore defining the continueWaitTimeout to some value different than the default (5).
    CubejsServerCore.create({
    ...
    orchestratorOptions: {
    queryCacheOptions: {
      queueOptions: {
        continueWaitTimeout: 120,
      },
    },
    preAggregationsOptions: {
      queueOptions: {
        continueWaitTimeout: 120,
      },
    },
    });
  2. Make a REST API call resulting in a query that takes more than 5s to run.
  3. Notice a Continue wait response after 5s. (Also visible in the logs, screenshot below).

Expected behavior I expected to receive a Continue Wait response only after the configured continueWaitTimeout.

Screenshots

Screen Shot 2019-10-04 at 00 47 20

Version: @cubejs-backend/server-core: 0.10.46

Notes: This might be related to #224 but is also happening in production where redis is being used, so I am not sure.

paveltiunov commented 5 years ago

@vieira I see. Seems like you expect to override api-gateway continue wait timeout which is not overridable right now: https://github.com/cube-js/cube.js/blob/master/packages/cubejs-server-core/core/OrchestratorApi.js#L24

I think we can introduce some global continueWaitTimeout CubejsServerCore option which will be used here and by all queues by default.