Skip to content

Commit 65edea8

Browse files
fix failing tests
1 parent 4d3090a commit 65edea8

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

doc/modules/ROOT/pages/common-usage/monitoring-system.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ This procedure can help a user realize which of his operations might be memory d
121121

122122
A user can access only his own graphs or tasks, but an admin can obtain information for all users.
123123

124-
[[syntax]]
124+
[[mem-reporting-syntax]]
125125
==== Syntax
126126
.List the graphs and tasks of a user along with their memory footprint.
127127
[source, cypher, role=noplay]
@@ -173,7 +173,7 @@ The `gds.listMemory.summary` procedure provides an overview of the total graph m
173173

174174
A user can access only his own graphs or tasks, but an admin can obtain information for all users.
175175

176-
[[syntax]]
176+
[[mem-summary-syntax]]
177177
==== Syntax
178178
.List the graphs and tasks of a user along with their memory footprint.
179179
[source, cypher, role=noplay]

doc/modules/ROOT/pages/operations-reference/additional-operation-references.adoc

+3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@
2727
| xref:common-usage/debug-sysinfo.adoc[Status of the system] | `gds.debug.sysInfo` label:procedure[Procedure]
2828
| xref:installation/configure-apache-arrow-server.adoc[Monitoring] | `gds.debug.arrow` label:procedure[Procedure]
2929
| xref:common-usage/monitoring-system.adoc[Get an overview of the system's workload and available resources] | `gds.systemMonitor` label:procedure[Procedure]
30+
| xref:common-usage/monitoring-system.adoc[Detailed memory footprint reporting] | `gds.listMemory` label:procedure[Procedure]
31+
| xref:common-usage/monitoring-system.adoc[Memory footprint summary] | `gds.listMemory.summary` label:procedure[Procedure]
3032
| xref:management-ops/backup-restore.adoc[Back-up graphs and models to disk] | `gds.backup` label:procedure[Procedure]
3133
| xref:management-ops/backup-restore.adoc[Restore persisted graphs and models to memory] | `gds.restore` label:procedure[Procedure]
3234
| xref:production-deployment/defaults-and-limits.adoc[List configured defaults] | `gds.config.defaults.list` label:procedure[Procedure]
3335
| xref:production-deployment/defaults-and-limits.adoc[Configure a default] | `gds.config.defaults.set` label:procedure[Procedure]
3436
| xref:production-deployment/defaults-and-limits.adoc#_limits_on_configuration_values[List configured limits] | `gds.config.limits.list` label:procedure[Procedure]
3537
| xref:production-deployment/defaults-and-limits.adoc#_limits_on_configuration_values[Configure a limit] | `gds.config.limits.set` label:procedure[Procedure]
38+
3639
|===

open-packaging/src/test/java/org/neo4j/gds/OpenGdsProcedureSmokeTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ class OpenGdsProcedureSmokeTest extends BaseProcTest {
519519
"gds.prizeSteinerTree.stream",
520520
"gds.prizeSteinerTree.stream.estimate",
521521

522+
"gds.listMemory",
523+
"gds.listMemory.summary",
524+
522525
"gds.version"
523526
);
524527

@@ -590,7 +593,7 @@ void countShouldMatch() {
590593
);
591594

592595
// If you find yourself updating this count, please also update the count in SmokeTest.kt
593-
int expectedCount = 432;
596+
int expectedCount = 434;
594597
assertEquals(
595598
expectedCount,
596599
returnedRows,

progress-tracking/src/main/java/org/neo4j/gds/mem/TaskMemoryContainer.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,13 @@ void reserve(String username, String taskName, JobId jobId,long memoryAmount){
4444
}
4545

4646
long removeTask(UserTask task){
47-
var mem= memoryInUse.getOrDefault(task.username(), EMPTY_HASH_MAP).remove(task.jobId()).getRight();
48-
allocatedMemory.addAndGet(-mem);
49-
return mem;
47+
var memPair= memoryInUse.getOrDefault(task.username(), EMPTY_HASH_MAP).remove(task.jobId());
48+
if (memPair !=null){
49+
var mem = memPair.getRight();
50+
allocatedMemory.addAndGet(-mem);
51+
return mem;
52+
}
53+
return allocatedMemory.get();
5054
}
5155

5256
long taskReservedMemory(){

0 commit comments

Comments
 (0)