majensen / libneo4j-client

neo4j-client -- Neo4j Command Line Interface (CLI)
https://neo4j-client.net
Apache License 2.0
1 stars 2 forks source link

Avoid tx timeout unless explicitly requested by the user #1

Closed johannessen closed 3 years ago

johannessen commented 3 years ago

A transaction timeout can be specified in the server config (dbms.transaction.timeout) or by the client in Bolt (RUN/BEGIN {tx_timeout}). If no timeout is explicitly set by the server or the client, the server default of 0 is used, which disables the feature altogether.

At version https://github.com/majensen/libneo4j-client/commit/9b5f358d5eeb0a1378515f46469967f47b8cadd0, neo4j-client uses a default tx timeout of 60 seconds. Disabling the timeout doesn’t appear to be possible.

This issue was previously mentioned in https://github.com/cleishm/libneo4j-client/issues/49#issuecomment-745746728. @majensen

Steps

  1. :begin
  2. Type a statement slowly (taking over 60 s), then send it to the server.

Expected

The statement is executed normally.

Actual

A “Transaction timed out” error.

Possible solution

I think that omitting the tx_timeout field from the BEGIN (and RUN) message will resolve this issue. The field should probably only be sent if a timeout is explicitly requested by the user.

majensen commented 3 years ago

@johannessen try this - you can set timeout to 0 to inhibit timeout, or set to -1 to use server-side setting.

johannessen commented 3 years ago

Yep, :begin 0 or :begin -1 does the trick. Thanks! But I still think that -1 should be the default in the interactive client if the user doesn’t specify a timeout at all with :begin. (See #5 about that.)