Skip to content

Commit

Permalink
Merge pull request #8562 from yuvalr1neo/native-proj-subtask-end-2.5
Browse files Browse the repository at this point in the history
Ending subtask in finally block - 2.5
  • Loading branch information
yuvalr1neo authored Jan 8, 2024
2 parents cb354ae + cab8f05 commit 1e330b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public final T call() {
)
);

} finally {
progressTracker.endSubTask("Store Scan");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1e330b5

Please sign in to comment.