From 5042a62d6f651f465ad2eeb477f90547be8e9ff7 Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Fri, 13 Jan 2023 16:04:35 -0500 Subject: [PATCH 1/2] Hopefully stop OOMs --- .../lifecycle/execution/stores/ValueStore.scala | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala index e913e5c6b3b..2804f413b0b 100644 --- a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala +++ b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala @@ -27,15 +27,10 @@ object ValueStore { case class ValueStore(store: Table[OutputPort, ExecutionIndex, WomValue]) { override def toString: String = { - import io.circe.syntax._ - import io.circe.Printer + import common.util.StringUtil.EnhancedToStringable - val values = store.valuesTriplet.map { - case (node, None, value) => node.name -> value.valueString - case (node, index, value) => s"${node.name}:${index.fromIndex}" -> value.valueString - }.toMap - - values.asJson.printWith(Printer.spaces2.copy(dropNullValues = true, colonLeft = "")) + // ValueStores can be large and have been known to cause OOMs during unbounded stringification + store.valuesTriplet.toPrettyElidedString(limit = 1000) } final def add(values: Map[ValueKey, WomValue]): ValueStore = { From 6e6ace7567a3df01ebdcc0d1bb452b86559635a6 Mon Sep 17 00:00:00 2001 From: Adam Nichols Date: Tue, 17 Jan 2023 14:52:34 -0500 Subject: [PATCH 2/2] Implement Chris's much better suggestion --- .../lifecycle/execution/stores/ValueStore.scala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala index 2804f413b0b..a5c1d6fc995 100644 --- a/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala +++ b/engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/stores/ValueStore.scala @@ -28,9 +28,15 @@ case class ValueStore(store: Table[OutputPort, ExecutionIndex, WomValue]) { override def toString: String = { import common.util.StringUtil.EnhancedToStringable + import io.circe.syntax._ + import io.circe.Printer - // ValueStores can be large and have been known to cause OOMs during unbounded stringification - store.valuesTriplet.toPrettyElidedString(limit = 1000) + val values = store.valuesTriplet.map { + case (node, None, value) => node.name -> value.toPrettyElidedString(limit = 100) + case (node, index, value) => s"${node.name}:${index.fromIndex}" -> value.toPrettyElidedString(limit = 100) + }.toMap + + values.asJson.printWith(Printer.spaces2.copy(dropNullValues = true, colonLeft = "")) } final def add(values: Map[ValueKey, WomValue]): ValueStore = {