From dda4d2c37a19425d21bd2b4004e2b9af0b1e4a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Osipiuk?= Date: Tue, 17 May 2022 15:18:18 +0200 Subject: [PATCH] Properly update node allocator state on release Statement ordering was incorrect previously and routine to process pending acquires was woken up before whole state related to released node was updated. It could still be observed by routine that released node is occupied and pending acquire was not fulfilled. --- .../execution/scheduler/BinPackingNodeAllocatorService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java b/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java index ea823691f06e..444cf8273e1f 100644 --- a/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java +++ b/core/trino-main/src/main/java/io/trino/execution/scheduler/BinPackingNodeAllocatorService.java @@ -399,8 +399,8 @@ public void release() node.cancel(true); if (node.isDone() && !node.isCancelled()) { deallocateMemory(getFutureValue(node)); - wakeupProcessPendingAcquires(); checkState(fulfilledAcquires.remove(this), "node lease %s not found in fulfilledAcquires %s", this, fulfilledAcquires); + wakeupProcessPendingAcquires(); } } else {