style95 commented on code in PR #5442:
URL: https://github.com/apache/openwhisk/pull/5442#discussion_r1322074596
##########
common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala:
##########
@@ -72,16 +76,19 @@ class PoolingRestClient(
// Additional queue in case all connections are busy. Should hardly ever be
// filled in practice but can be useful, e.g., in tests starting many
// asynchronous requests in a very short period of time.
- private val requestQueue = Source
- .queue(queueSize, OverflowStrategy.dropNew)
Review Comment:
If the overflow strategy is not specified, what happens now in case the
queue is full?
##########
common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala:
##########
@@ -127,7 +134,13 @@ class PoolingRestClient(
}
}
- def shutdown(): Future[Unit] = Future.unit
+ def shutdown(): Future[Unit] = {
+ killSwitch.shutdown()
+ Try(requestQueue.complete()).recover {
+ case t: IllegalStateException => logging.error(this, t.getMessage)
Review Comment:
If the stream is already completed, I think this is a normal case.
Do we have to print an error log for this?
##########
common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala:
##########
@@ -48,6 +50,8 @@ class PoolingRestClient(
timeout: Option[FiniteDuration] = None)(implicit system: ActorSystem) {
require(protocol == "http" || protocol == "https", "Protocol must be one of
{ http, https }.")
+ private val logging = new AkkaLogging(system.log)
Review Comment:
It's better to get the logging from the implicit parameter.
Most callers of this client have an implicit parameter for logging.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]