From 5252a05f36db19e1cc6c42aeeff7da087a64df5f Mon Sep 17 00:00:00 2001 From: suryaacharan Date: Mon, 28 Sep 2026 14:32:24 -0700 Subject: [PATCH 1/3] feat(computing-unit-managing-service): say how to free a slot when the CU quota is reached The quota error only said "You may only have N computing-unit(s) running at the same time". It now adds: "Reuse one of your running computing units, or terminate one you no longer need." Refs TEX-86 Co-Authored-By: Claude Opus 5.5 (cherry picked from commit 58999ccedffb81e9cd8d96b253fc06871ca2e287) --- .../service/util/ComputingUnitManagingServiceException.scala | 3 ++- .../util/ComputingUnitManagingServiceExceptionSpec.scala | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala index 22660113e99..585bbeeedf6 100644 --- a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala +++ b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala @@ -37,7 +37,8 @@ final case class InsufficientComputingResource(resourceType: String) // User has reached the per-user CU-quota (number of running units) final case class InsufficientComputingUnitQuota(maxNumberOfComputingUnit: Int) extends ComputingUnitManagingServiceException( - s"You may only have $maxNumberOfComputingUnit computing-unit(s) running at the same time" + s"You may only have $maxNumberOfComputingUnit computing-unit(s) running at the same time. " + + "Reuse one of your running computing units, or terminate one you no longer need." ) // default exception fallback diff --git a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala index 2e95eeece48..620f42e10a2 100644 --- a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala +++ b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala @@ -33,9 +33,10 @@ class ComputingUnitManagingServiceExceptionSpec extends AnyFlatSpec with Matcher "Insufficient CPU available in the server. Please decrease the requested amount or try again later." } - "InsufficientComputingUnitQuota" should "render the quota message" in { + "InsufficientComputingUnitQuota" should "render the quota message and how to free a slot" in { InsufficientComputingUnitQuota(3).getMessage shouldBe - "You may only have 3 computing-unit(s) running at the same time" + "You may only have 3 computing-unit(s) running at the same time. " + + "Reuse one of your running computing units, or terminate one you no longer need." } "InternalError" should "default to a generic message" in { From fc94582239bc46025c80b5b329367c1abc7245b2 Mon Sep 17 00:00:00 2001 From: suryaacharan Date: Thu, 8 Oct 2026 11:42:24 -0700 Subject: [PATCH 2/3] fix(computing-unit-managing-service): say which action frees a slot for each unit type Local units count toward the running-unit limit too, and the UI removes them with "Disconnect" (the same terminate call, which frees the slot). Co-Authored-By: Claude Opus 5.5 --- .../service/util/ComputingUnitManagingServiceException.scala | 2 +- .../util/ComputingUnitManagingServiceExceptionSpec.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala index 585bbeeedf6..a8e84013462 100644 --- a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala +++ b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala @@ -38,7 +38,7 @@ final case class InsufficientComputingResource(resourceType: String) final case class InsufficientComputingUnitQuota(maxNumberOfComputingUnit: Int) extends ComputingUnitManagingServiceException( s"You may only have $maxNumberOfComputingUnit computing-unit(s) running at the same time. " + - "Reuse one of your running computing units, or terminate one you no longer need." + "Reuse a running computing unit, terminate a cloud unit, or disconnect a local unit you no longer need." ) // default exception fallback diff --git a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala index 620f42e10a2..f803a0d9541 100644 --- a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala +++ b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala @@ -36,7 +36,7 @@ class ComputingUnitManagingServiceExceptionSpec extends AnyFlatSpec with Matcher "InsufficientComputingUnitQuota" should "render the quota message and how to free a slot" in { InsufficientComputingUnitQuota(3).getMessage shouldBe "You may only have 3 computing-unit(s) running at the same time. " + - "Reuse one of your running computing units, or terminate one you no longer need." + "Reuse a running computing unit, terminate a cloud unit, or disconnect a local unit you no longer need." } "InternalError" should "default to a generic message" in { From ec6eba433cb47524b935c74ee886f1d6817a8764 Mon Sep 17 00:00:00 2001 From: suryaacharan Date: Wed, 14 Oct 2026 19:53:27 -0700 Subject: [PATCH 3/3] fix(computing-unit-managing-service): spell the quota message consistently and name Kubernetes units "computing-unit(s)" becomes "computing unit(s)" to match the rest of the message, and "cloud unit" becomes "Kubernetes unit", which is what the UI calls them. Co-Authored-By: Claude Opus 5.5 --- .../service/util/ComputingUnitManagingServiceException.scala | 4 ++-- .../util/ComputingUnitManagingServiceExceptionSpec.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala index a8e84013462..2bcf60ed1c0 100644 --- a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala +++ b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala @@ -37,8 +37,8 @@ final case class InsufficientComputingResource(resourceType: String) // User has reached the per-user CU-quota (number of running units) final case class InsufficientComputingUnitQuota(maxNumberOfComputingUnit: Int) extends ComputingUnitManagingServiceException( - s"You may only have $maxNumberOfComputingUnit computing-unit(s) running at the same time. " + - "Reuse a running computing unit, terminate a cloud unit, or disconnect a local unit you no longer need." + s"You may only have $maxNumberOfComputingUnit computing unit(s) running at the same time. " + + "Reuse a running computing unit, terminate a Kubernetes unit, or disconnect a local unit you no longer need." ) // default exception fallback diff --git a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala index f803a0d9541..9a0c619b343 100644 --- a/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala +++ b/computing-unit-managing-service/src/test/scala/org/apache/texera/service/util/ComputingUnitManagingServiceExceptionSpec.scala @@ -35,8 +35,8 @@ class ComputingUnitManagingServiceExceptionSpec extends AnyFlatSpec with Matcher "InsufficientComputingUnitQuota" should "render the quota message and how to free a slot" in { InsufficientComputingUnitQuota(3).getMessage shouldBe - "You may only have 3 computing-unit(s) running at the same time. " + - "Reuse a running computing unit, terminate a cloud unit, or disconnect a local unit you no longer need." + "You may only have 3 computing unit(s) running at the same time. " + + "Reuse a running computing unit, terminate a Kubernetes unit, or disconnect a local unit you no longer need." } "InternalError" should "default to a generic message" in {