You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I build a new image from cubejs/cube:v0.33.61, and fork duckdb driver:https://github.com/cube-js/cube/tree/v0.34.40/packages/cubejs-duckdb-driver, add log on the init function.
When i send post query, the querytype is multi, There are two records about init,i think the dirver's constructor has called twice,and created to duckdb instance.
To Reproduce
Steps to reproduce the behavior:
Frok duckdb' project to repo and name it "customize-duckdb-cubejs-driver" , add log in constructor and init function
Build New Image:
Dockfile
`
FROM cubejs/cube:v0.34.40
RUN apt-get update && apt-get install -y git
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
RUN mkdir -p node_modules
COPY package.json .
COPY cube.js .
COPY schema ./schema
RUN --mount=type=ssh npm install
`
the package.json that dependencies the repo of step1 { ... "dependencies": { "customize-duckdb-cubejs-driver": "bitbucket:test/customize-duckdb-cubejs-driver" } ... }
Hi @wlf061 👋 Let me add @ovr so he might provide his opinion as well. I think there are no strict guarantees on how many times a driver would be initialized. It might happen multiple times while Cube is running.
`
we use default datasource and there has no configure of orchestrator, from the log, the orchestratorId are same for the multi query, Although created twice, only one instance is stored here.
release execution chain
`
servers.ts:releaseConnections ->OrchestratorStorage.ts:releaseConnections->OrchestratorApi.ts:release->driver.release
public async releaseConnections() {
const result = [];
for (const orchestratorApi of this.storage.values()) {
result.push(orchestratorApi.release());
}
await Promise.all(result);
this.storage.clear();
}
`
you can see, there has just release one driver.I think there has a leak.
If there is something wrong with the analysis here, please let me know
Describe the bug
I build a new image from cubejs/cube:v0.33.61, and fork duckdb driver:https://github.com/cube-js/cube/tree/v0.34.40/packages/cubejs-duckdb-driver, add log on the init function.
When i send post query, the querytype is multi, There are two records about init,i think the dirver's constructor has called twice,and created to duckdb instance.
To Reproduce
Steps to reproduce the behavior:
Frok duckdb' project to repo and name it "customize-duckdb-cubejs-driver" , add log in constructor and init function

Build New Image:
`
FROM cubejs/cube:v0.34.40
RUN apt-get update && apt-get install -y git
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan bitbucket.org >> ~/.ssh/known_hosts
RUN mkdir -p node_modules
COPY package.json .
COPY cube.js .
COPY schema ./schema
RUN --mount=type=ssh npm install
`
{ ... "dependencies": { "customize-duckdb-cubejs-driver": "bitbucket:test/customize-duckdb-cubejs-driver" } ... }
{ "query": { "measures": [ "test.currency", ], "dimensions": [ "test.local_book_date" ], "timeDimensions": [{ "dimension": "test.local_book_date", "compareDateRange": [["2023-06-01","2023-07-31"], ["2023-08-01","2043-12-11"]] } ] }, "queryType":"multi" }
The driver and db instance are init twice, the related log
`
taihu-cube-pc-cube_api-1 | create duckdb driver
taihu-cube-pc-cube_api-1 | create duckdb driver
.....
taihu-cube-pc-cube_api-1 | init duckdb
taihu-cube-pc-cube_api-1 | init duckdb
`
Expected behavior
The Driver and db are init once.
Version:
v0.33.61 and v.34.40
The text was updated successfully, but these errors were encountered: