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
487 stars 60 forks source link

The last CONSOLE.log statement in a SQL SCRIPT is buffered but not output #1651

Closed finduspedersen closed 2 months ago

finduspedersen commented 3 months ago

ArcadeDB Version:

24.5.1

OS and JDK Version:

Official Docker image

Expected behavior

Both lines should be output every time the script is run.

Actual behavior

The last line (DEBUG2) is buffered but not output until the script is run again.

Steps to reproduce

CONSOLE.log map('DEBUG1', 'This is logged in the first run');
CONSOLE.log map('DEBUG2', 'This is not logged until the second run');
gramian commented 3 months ago

Hi,

I cannot reproduce this running on bare metal via the console or studio. I will try tomorrow using Docker.

Have you tried three logging statements or using a higher log level?

finduspedersen commented 3 months ago

What I am describing is NOT what is shown in the studio output (because that seems to work correctly), but what is (not) displayed as output from the running database server.

PS> docker logs arcadedb

I have tried hundreds of log statements in my scripts, and consistently, the last one is never output in the database server's output.

gramian commented 3 months ago

Alright. I figured you were referring to the server's log output. So if the last one is missing, it maybe Java is not flushing its io buffer, I guess. Things that need to be tested, I think, is what happens if after the second log an error happens; is the missing log statemenet then printed before or after the error? This could hint at if this is an ArcadeDB or Java problem. Also one could try adding newline (ie \n) to manually force a flush. If this is the case then maybe Arcade needs to append a newline after every log statement.

gramian commented 3 months ago

I cannot reproduce this under MacOS 12.7 using Docker Desktop.

finduspedersen commented 2 months ago

Maybe it's just a Docker Desktop issue and not related to ArcadeDB...

lvca commented 2 months ago

I think this is docker, ArcadeDB is not buffering logs at all.