Skip to content

Commit aef5028

Browse files
authored
Merge pull request #8939 from neo-technology/close-task-cypher-projection
Fix Cypher Projection progress tracking bug
2 parents 15b2389 + 34f748e commit aef5028

File tree

1 file changed

+39
-34
lines changed
  • legacy-cypher-projection/src/main/java/org/neo4j/gds/legacycypherprojection

1 file changed

+39
-34
lines changed

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

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -163,40 +163,45 @@ public GraphDimensions estimationDimensions() {
163163
public CSRGraphStore build() {
164164
// Temporarily override the security context to enforce read-only access during load
165165
return readOnlyTransaction().apply((tx, ktx) -> {
166-
BatchLoadResult nodeCount = new CountingCypherRecordLoader(
167-
cypherConfig.nodeQuery(),
168-
CypherRecordLoader.QueryType.NODE,
169-
cypherConfig,
170-
loadingContext
171-
).load(ktx.internalTransaction());
172-
173-
progressTracker.beginSubTask("Loading");
174-
var nodes = new CypherNodeLoader(
175-
cypherConfig.nodeQuery(),
176-
nodeCount.rows(),
177-
cypherConfig,
178-
loadingContext,
179-
progressTracker
180-
).load(ktx.internalTransaction());
181-
182-
var relationshipImportResult = new CypherRelationshipLoader(
183-
cypherConfig.relationshipQuery(),
184-
nodes.idMap(),
185-
cypherConfig,
186-
loadingContext,
187-
progressTracker
188-
).load(ktx.internalTransaction());
189-
190-
var graphStore = createGraphStore(
191-
nodes,
192-
relationshipImportResult
193-
);
194-
195-
progressTracker.endSubTask("Loading");
196-
197-
logLoadingSummary(graphStore);
198-
199-
return graphStore;
166+
try {
167+
progressTracker.beginSubTask("Loading");
168+
BatchLoadResult nodeCount = new CountingCypherRecordLoader(
169+
cypherConfig.nodeQuery(),
170+
CypherRecordLoader.QueryType.NODE,
171+
cypherConfig,
172+
loadingContext
173+
).load(ktx.internalTransaction());
174+
175+
var nodes = new CypherNodeLoader(
176+
cypherConfig.nodeQuery(),
177+
nodeCount.rows(),
178+
cypherConfig,
179+
loadingContext,
180+
progressTracker
181+
).load(ktx.internalTransaction());
182+
183+
var relationshipImportResult = new CypherRelationshipLoader(
184+
cypherConfig.relationshipQuery(),
185+
nodes.idMap(),
186+
cypherConfig,
187+
loadingContext,
188+
progressTracker
189+
).load(ktx.internalTransaction());
190+
191+
var graphStore = createGraphStore(
192+
nodes,
193+
relationshipImportResult
194+
);
195+
196+
progressTracker.endSubTask("Loading");
197+
198+
logLoadingSummary(graphStore);
199+
200+
return graphStore;
201+
} catch (RuntimeException ex) {
202+
progressTracker.endSubTaskWithFailure();
203+
throw ex;
204+
}
200205
});
201206
}
202207

0 commit comments

Comments
 (0)