-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wait mode for cli #7
Comments
Hey @blackrez the server process gets killed if the parent exists, which should apply find to the DuckDB CLI terminating. |
Currently the serve function runs in a separate thread and returns to the DuckDB prompt as if a query succeeded with results, which I suppose causes your serverless execution to terminate. To have a blocking approach the server should run in the main thread and that's possible, but not sure desirable or free from side effects.... if you want you can try this locally: #8 Note: https://github.com/metrico/quackpipe does this job better at the moment if you need a serverless execution |
This is exactly what I need (and a lot of people I think). |
Are you referring to Quackpipe or the PR? If you're referring to the PR, we can add this in. The foreground mode works, but before merging we really need to work on proper thread termination to avoid data loss, corruption, etc. |
Alright we can add this in. The foreground mode works, but before merging we really need to work on proper thread termination to avoid data loss, corruption, etc.Message ID: ***@***.***>
Stupid question, but is duckdb_cli already handle all that situations ?
|
DuckDB CLI is not DuckDB and our code runs in a separate thread inside an extension which means we have to make sure the states are propagated, etc. Which I'm no expert of but with this said, I've added the missing code to the branch and it seems to behave as expected if you wanna try it locally: > git clone https://github.com/lmangani/duckdb-extension-httpserver
> cd duckdb-extension-httpserver
> git submodule update --init --recursive
> git checkout thread-options
# build the branch and set the foreground ENV
> GEN=ninja make
> export DUCKDB_HTTPSERVER_FOREGROUND=1
# test it
> ./build/release/duckdb |
@blackrez does the implementation match your usecase? |
@lmangani it matches with my usecase. |
merged, will be part of next release (no WIN32 support) |
I don't know how (and if) it's possible, but it would be interesting to have a kind of wait mode. My use case is use duckdb with gcp cloud run, a serverless docker service. I imagine something like
duckdb :memory: "LOAD httpserver; SELECT httpserve_start('0.0.0.0', 9999, wait=true);
And duckdb wait until a signal kill the process.The text was updated successfully, but these errors were encountered: