ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
486 stars 60 forks source link

Unexpect Behavior when issuing `shutdown` command over HTTP #1683

Closed apttap closed 1 month ago

apttap commented 1 month ago

ArcadeDB Version:

24.6.1

OS and JDK Version:

Ubuntu 22.04 LTS, openjdk version "11.0.23" 2024-04-16

Expected behavior

The documentation states that for a shutdown command it should return a json reponse of:

{ "result": 'ok' }

Actual behavior

curl yields an empty reponse, and fetch or axios.post yields an error

Steps to reproduce

$ curl -X POST http://localhost:2480/api/v1/server \
       -d '{ "command": "shutdown" }' \
       -H "Content-Type: application/json" \
       --user root:arcadedb-password

will yield: curl: (52) Empty reply from server

or a post from axios (nodejs):

axios
  .post("http://localhost:2480/api/v1/server", {
    "command": "shutdown",
  }, {
    headers: {
      Authorization: `Basic ${Buffer.from("root:arcadedb-password").toString('base64')}`
    }
  })
  .then((res)=>console.log(res.data));

will throw an exception

as will a fetch (nodejs):

fetch("http://localhost:2480/api/v1/server", {
  method: "POST",
  headers: {
    Authorization: `Basic ${Buffer.from("root:arcadedb-password").toString('base64')}`
  },
    body: JSON.stringify({"command": "shutdown"}),
  })
  .then(console.log);
lvca commented 1 month ago

Now the shutdown is executed on a different thread and the command returns "ok".