diff --git a/native-projection/src/main/java/org/neo4j/gds/projection/ScanningRecordsImporter.java b/native-projection/src/main/java/org/neo4j/gds/projection/ScanningRecordsImporter.java index 03dd4af017..c9d6114e7d 100644 --- a/native-projection/src/main/java/org/neo4j/gds/projection/ScanningRecordsImporter.java +++ b/native-projection/src/main/java/org/neo4j/gds/projection/ScanningRecordsImporter.java @@ -109,6 +109,7 @@ public final T call() { ) ); + } finally { progressTracker.endSubTask("Store Scan"); } diff --git a/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java b/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java index fa905e48b0..9d59934872 100644 --- a/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java +++ b/proc/catalog/src/test/java/org/neo4j/gds/catalog/GraphProjectProcTest.java @@ -38,11 +38,13 @@ import org.neo4j.gds.api.DatabaseId; import org.neo4j.gds.api.DefaultValue; import org.neo4j.gds.api.Graph; +import org.neo4j.gds.compat.GraphDatabaseApiProxy; import org.neo4j.gds.config.ConcurrencyConfig; import org.neo4j.gds.core.Aggregation; import org.neo4j.gds.core.concurrency.DefaultPool; import org.neo4j.gds.core.concurrency.ParallelUtil; import org.neo4j.gds.core.loading.GraphStoreCatalog; +import org.neo4j.gds.core.utils.progress.TaskStore; import org.neo4j.gds.test.TestProc; import org.neo4j.gds.utils.StringJoining; @@ -1379,6 +1381,19 @@ void cypherCreationShouldNotReturnProjections() { }); } + @Test + void clearTasksOnFailure() { + runQuery("CREATE ({prop: \"stringProp\"}), ()"); + + assertThatThrownBy(() -> + runQuery("CALL gds.graph.project('g', '*', '*', {nodeProperties: \"prop\"}) YIELD nodeProjection")) + .isInstanceOf(Exception.class) + .hasMessageContaining("Loading of values of type String is currently not supported");; + + var taskStore = GraphDatabaseApiProxy.resolveDependency(db, TaskStore.class); + assertTrue(taskStore.isEmpty()); + } + private Graph relPropertyGraph(String graphName, RelationshipType relationshipType, String property) { return GraphStoreCatalog .get(getUsername(), DatabaseId.of(db.databaseName()), graphName)