joni-jones commented on code in PR #5442:
URL: https://github.com/apache/openwhisk/pull/5442#discussion_r1322151656


##########
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:
   I'm not sure if `Killswitch` shuts it down all the time, in theory, it 
should, but I remember seeing an issue with memory leak only with having a kill 
switch and without `queue.complete`. By the number of these log messages and 
requests through the queue, it's hard to say if the kill switch does it all the 
time (maybe due to concurrent requests as well), but I saw a much smaller 
number of exceptions than requests that went through the queue.
   
   I think it might also happen when some other place has already closed the 
queue.
   
   Having just a warning message might be fine as well.



-- 
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]

Reply via email to