Skip to content

Commit 71944a4

Browse files
committed
Merge branch 'upstream-main'
2 parents 22e9f12 + 43942a4 commit 71944a4

110 files changed

Lines changed: 4540 additions & 906 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bolt/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>com.arcadedb</groupId>
2727
<artifactId>arcadedb-parent</artifactId>
28-
<version>26.5.1-SNAPSHOT</version>
28+
<version>26.5.1</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

console/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>com.arcadedb</groupId>
2727
<artifactId>arcadedb-parent</artifactId>
28-
<version>26.5.1-SNAPSHOT</version>
28+
<version>26.5.1</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

console/src/main/java/com/arcadedb/console/Console.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -860,9 +860,10 @@ else if (subject.startsWith("type ")) {
860860
final TableFormatter table = new TableFormatter((text, args) -> output(0, text, args));
861861
table.setMaxWidthSize(maxWidth);
862862

863-
final ResultSet typeResult = databaseProxy.command("sql", "select from schema:types where name = \"" + typeName + "\"");
864-
if (!typeResult.hasNext())
865-
return;
863+
try (final ResultSet typeResult = databaseProxy.command("sql",
864+
"select from schema:types where name = \"" + typeName + "\"")) {
865+
if (!typeResult.hasNext())
866+
return;
866867

867868
final Result result = typeResult.next();
868869

@@ -908,6 +909,7 @@ else if (subject.startsWith("type ")) {
908909
}
909910
table.writeRows(rows, -1);
910911
}
912+
}
911913

912914
} else
913915
throw new ConsoleException("Information about '" + subject + "' is not available");

coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<parent>
2727
<groupId>com.arcadedb</groupId>
2828
<artifactId>arcadedb-parent</artifactId>
29-
<version>26.5.1-SNAPSHOT</version>
29+
<version>26.5.1</version>
3030
<relativePath>../pom.xml</relativePath>
3131
</parent>
3232

e2e-ha/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>com.arcadedb</groupId>
2727
<artifactId>arcadedb-parent</artifactId>
28-
<version>26.5.1-SNAPSHOT</version>
28+
<version>26.5.1</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

e2e/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>com.arcadedb</groupId>
2727
<artifactId>arcadedb-parent</artifactId>
28-
<version>26.5.1-SNAPSHOT</version>
28+
<version>26.5.1</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

engine/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<parent>
2626
<groupId>com.arcadedb</groupId>
2727
<artifactId>arcadedb-parent</artifactId>
28-
<version>26.5.1-SNAPSHOT</version>
28+
<version>26.5.1</version>
2929
<relativePath>../pom.xml</relativePath>
3030
</parent>
3131

engine/src/main/java/com/arcadedb/GlobalConfiguration.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -750,13 +750,6 @@ source via leadership transfer, and the others either bootstrap locally (matchin
750750
knows which peer was unreachable.""",
751751
Long.class, 120_000L),
752752

753-
HA_BOOTSTRAP_DELTA_THRESHOLD("arcadedb.ha.bootstrapDeltaThreshold", SCOPE.SERVER,
754-
"""
755-
Maximum lastTxId gap (number of transactions) for which a follower can be brought up to date by replaying \
756-
a WAL delta from the source peer instead of downloading a full snapshot. Above this gap the leader-shipped \
757-
full-snapshot path is used. Set to 0 to disable delta resync entirely.""",
758-
Long.class, 100_000L),
759-
760753
HA_SNAPSHOT_MAX_CONCURRENT("arcadedb.ha.snapshotMaxConcurrent", SCOPE.SERVER,
761754
"Maximum number of concurrent snapshot downloads served by the leader. Requests over this limit receive HTTP 503.",
762755
Integer.class, 2),

engine/src/main/java/com/arcadedb/database/async/AsyncResultsetCallback.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,25 @@
3131
public interface AsyncResultsetCallback {
3232
/**
3333
* Invoked as soon as the command has been executed.
34+
* <p>
35+
* <b>Ownership contract:</b> the supplied {@link ResultSet} is owned by the async executor
36+
* and is closed by the framework <i>immediately after this method returns</i>. Implementations
37+
* MUST consume (iterate / drain / materialize via {@code stream().toList()}, etc.) the result
38+
* set synchronously inside this callback. The reference must not be stored on a field or
39+
* handed off to another thread for deferred iteration.
40+
* <p>
41+
* <b>Failure mode if violated:</b> any post-close access to the underlying execution-plan
42+
* iterators (hasNext / next) will observe drained/closed state and may either return false
43+
* silently, throw {@code IllegalStateException}, or surface as a downstream
44+
* {@code NullPointerException} depending on the engine path. There is no defensive open-state
45+
* check on the {@code ResultSet} interface, so misuse is not explicit - treat this Javadoc as
46+
* the contract.
47+
* <p>
48+
* The framework-level close was added in the #4197 audit to avoid leaking the execution plan
49+
* (and the parallel-scan worker threads it pins) when the callback is fire-and-forget, such as
50+
* a logging-only completion handler.
3451
*
35-
* @param resultset result set to fetch
52+
* @param resultset result set to fetch, valid only for the duration of this call
3653
*/
3754
void onComplete(final ResultSet resultset);
3855

engine/src/main/java/com/arcadedb/database/async/DatabaseAsyncCommand.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,13 @@ public DatabaseAsyncCommand(final ContextConfiguration configuration, final bool
5959

6060
@Override
6161
public void execute(final DatabaseAsyncExecutorImpl.AsyncThread async, final DatabaseInternal database) {
62-
try {
63-
final ResultSet resultset = idempotent ?
64-
parametersMap != null ?
65-
database.query(language, command, configuration, parametersMap) :
66-
database.query(language, command, configuration, parameters) :
67-
parametersMap != null ?
68-
database.command(language, command, configuration, parametersMap) :
69-
database.command(language, command, configuration, parameters);
62+
try (final ResultSet resultset = idempotent ?
63+
parametersMap != null ?
64+
database.query(language, command, configuration, parametersMap) :
65+
database.query(language, command, configuration, parameters) :
66+
parametersMap != null ?
67+
database.command(language, command, configuration, parametersMap) :
68+
database.command(language, command, configuration, parameters)) {
7069

7170
if (userCallback != null)
7271
userCallback.onComplete(resultset);

0 commit comments

Comments
 (0)