Skip to content

Commit 1e330b5

Browse files
authored
Merge pull request #8562 from yuvalr1neo/native-proj-subtask-end-2.5
Ending subtask in finally block - 2.5
2 parents cb354ae + cab8f05 commit 1e330b5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

native-projection/src/main/java/org/neo4j/gds/projection/ScanningRecordsImporter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public final T call() {
109109
)
110110
);
111111

112+
} finally {
112113
progressTracker.endSubTask("Store Scan");
113114
}
114115

proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@
3838
import org.neo4j.gds.api.DatabaseId;
3939
import org.neo4j.gds.api.DefaultValue;
4040
import org.neo4j.gds.api.Graph;
41+
import org.neo4j.gds.compat.GraphDatabaseApiProxy;
4142
import org.neo4j.gds.config.ConcurrencyConfig;
4243
import org.neo4j.gds.core.Aggregation;
4344
import org.neo4j.gds.core.concurrency.DefaultPool;
4445
import org.neo4j.gds.core.concurrency.ParallelUtil;
4546
import org.neo4j.gds.core.loading.GraphStoreCatalog;
47+
import org.neo4j.gds.core.utils.progress.TaskStore;
4648
import org.neo4j.gds.test.TestProc;
4749
import org.neo4j.gds.utils.StringJoining;
4850

@@ -1379,6 +1381,19 @@ void cypherCreationShouldNotReturnProjections() {
13791381
});
13801382
}
13811383

1384+
@Test
1385+
void clearTasksOnFailure() {
1386+
runQuery("CREATE ({prop: \"stringProp\"}), ()");
1387+
1388+
assertThatThrownBy(() ->
1389+
runQuery("CALL gds.graph.project('g', '*', '*', {nodeProperties: \"prop\"}) YIELD nodeProjection"))
1390+
.isInstanceOf(Exception.class)
1391+
.hasMessageContaining("Loading of values of type String is currently not supported");;
1392+
1393+
var taskStore = GraphDatabaseApiProxy.resolveDependency(db, TaskStore.class);
1394+
assertTrue(taskStore.isEmpty());
1395+
}
1396+
13821397
private Graph relPropertyGraph(String graphName, RelationshipType relationshipType, String property) {
13831398
return GraphStoreCatalog
13841399
.get(getUsername(), DatabaseId.of(db.databaseName()), graphName)

0 commit comments

Comments
 (0)