From 1c87d8d3206b0683233d73cb984a26acf677a05b Mon Sep 17 00:00:00 2001 From: Nicolas F Rouquette Date: Sun, 21 Jul 2019 13:20:24 -0700 Subject: [PATCH] Add explicit argument for maximumObjectLength indirectly used in watchWithOptions as bufsize --- .../src/main/scala/skuber/api/client/KubernetesClient.scala | 4 +++- .../scala/skuber/api/client/impl/KubernetesClientImpl.scala | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/main/scala/skuber/api/client/KubernetesClient.scala b/client/src/main/scala/skuber/api/client/KubernetesClient.scala index 5240526c..351585ba 100644 --- a/client/src/main/scala/skuber/api/client/KubernetesClient.scala +++ b/client/src/main/scala/skuber/api/client/KubernetesClient.scala @@ -381,6 +381,7 @@ trait KubernetesClient { * @param watchContinuouslyRequestTimeout the delay for continuously monitoring the pod progress * @param deletionMonitorRepeatDelay the delay for continuously monitoring the job deletion * @param pool a skuber pool to reuse, if any, or to create otherwise + * @param bufSize optional buffer size for received object updates, normally the default is more than enough * @return A future consisting of a triple of the following: * - the skuber pool suitable for subsequently executing other jobs on the same server * - the akka host connection pool that can be shutdown when no further jobs need to be executed on the same server @@ -393,7 +394,8 @@ trait KubernetesClient { podCompletion: WatchEvent[Pod] => Future[Unit], watchContinuouslyRequestTimeout: Duration, deletionMonitorRepeatDelay: FiniteDuration, - pool: Option[Pool[WatchSource.Start[Pod]]])(implicit jfmt: Format[Job], pfmt: Format[Pod], jrd: ResourceDefinition[Job], prd: ResourceDefinition[Pod]): + pool: Option[Pool[WatchSource.Start[Pod]]], + bufSize: Int = 10000)(implicit jfmt: Format[Job], pfmt: Format[Pod], jrd: ResourceDefinition[Job], prd: ResourceDefinition[Pod]): Future[(Pool[WatchSource.Start[Pod]], Option[Http.HostConnectionPool], WatchEvent[Pod])] /** diff --git a/client/src/main/scala/skuber/api/client/impl/KubernetesClientImpl.scala b/client/src/main/scala/skuber/api/client/impl/KubernetesClientImpl.scala index 76915ed4..22bcc7f4 100644 --- a/client/src/main/scala/skuber/api/client/impl/KubernetesClientImpl.scala +++ b/client/src/main/scala/skuber/api/client/impl/KubernetesClientImpl.scala @@ -642,7 +642,8 @@ class KubernetesClientImpl private[client] ( podCompletion: WatchEvent[Pod] => Future[Unit], watchContinuouslyRequestTimeout: Duration, deletionMonitorRepeatDelay: FiniteDuration, - pool: Option[Pool[WatchSource.Start[Pod]]])(implicit jfmt: Format[Job], pfmt: Format[Pod], jrd: ResourceDefinition[Job], prd: ResourceDefinition[Pod]) + pool: Option[Pool[WatchSource.Start[Pod]]], + bufSize: Int = 10000)(implicit jfmt: Format[Job], pfmt: Format[Pod], jrd: ResourceDefinition[Job], prd: ResourceDefinition[Pod]) : Future[(Pool[WatchSource.Start[Pod]], Option[Http.HostConnectionPool], WatchEvent[Pod])] = for { j <- create(job) @@ -652,6 +653,7 @@ class KubernetesClientImpl private[client] ( labelSelector = Some(labelSelector), timeoutSeconds = Some(watchContinuouslyRequestTimeout.toSeconds) ), + bufsize = bufSize, pool = pool ) .takeWhile(podProgress, inclusive = true)