Skip to content

Commit 09aef90

Browse files
authored
Merge pull request #9886 from neo-technology/legacy-cypher-taskstore
Clean up task store more often for Legacy Cypher Projection
2 parents 09ce117 + e704124 commit 09aef90

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherFactory.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ public GraphDimensions estimationDimensions() {
162162
@Override
163163
public CSRGraphStore build() {
164164
// Temporarily override the security context to enforce read-only access during load
165-
return readOnlyTransaction().apply((tx, ktx) -> {
166-
try {
165+
try {
166+
return readOnlyTransaction().apply((tx, ktx) -> {
167167
progressTracker.beginSubTask("Loading");
168168
BatchLoadResult nodeCount = new CountingCypherRecordLoader(
169169
cypherConfig.nodeQuery(),
@@ -198,11 +198,11 @@ public CSRGraphStore build() {
198198
logLoadingSummary(graphStore);
199199

200200
return graphStore;
201-
} catch (RuntimeException ex) {
202-
progressTracker.endSubTaskWithFailure();
203-
throw ex;
204-
}
205-
});
201+
});
202+
} catch (Throwable ex) {
203+
progressTracker.endSubTaskWithFailure();
204+
throw ex;
205+
}
206206
}
207207

208208
private ProgressTracker initProgressTracker() {

legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection/CypherQueryEstimator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.Collection;
2828

2929
import static org.neo4j.gds.utils.StringFormatting.formatWithLocale;
30-
import static org.neo4j.internal.kernel.api.security.AccessMode.Static.READ;
3130

3231
public class CypherQueryEstimator {
3332

@@ -48,7 +47,7 @@ public EstimationResult getRelationshipEstimation(String relationshipQuery) {
4847
}
4948

5049
private EstimationResult runEstimationQuery(String query, Collection<String> reservedColumns) {
51-
return context.withRestrictedAccess(READ).apply((tx, ktx) -> {
50+
return context.apply((tx, ktx) -> {
5251
var explainQuery = formatWithLocale("EXPLAIN %s", query);
5352
try (var result = tx.execute(explainQuery)) {
5453
var estimatedRows = (Number) result.getExecutionPlanDescription().getArguments().get("EstimatedRows");

0 commit comments

Comments
 (0)