He-Pin commented on code in PR #907:
URL: https://github.com/apache/pekko-management/pull/907#discussion_r3717622898


##########
discovery-aws-api/src/main/scala/org/apache/pekko/discovery/awsapi/ec2/Ec2TagBasedServiceDiscovery.scala:
##########
@@ -19,7 +19,7 @@ import com.amazonaws.retry.PredefinedRetryPolicies
 import com.amazonaws.services.ec2.model.{ DescribeInstancesRequest, Filter, 
Reservation }
 import com.amazonaws.services.ec2.{ AmazonEC2, AmazonEC2ClientBuilder }
 import org.apache.pekko
-import pekko.actor.ExtendedActorSystem
+import pekko.actor.{ CoordinatedShutdown, ExtendedActorSystem }
 import pekko.annotation.InternalApi
 import pekko.discovery.ServiceDiscovery.{ Resolved, ResolvedTarget }

Review Comment:
   One thing to consider: since ec2Client is now lazy, this shutdown task will 
force-initialize the client during CoordinatedShutdown even if discovery was 
never used — which means AWS credential resolution happens at shutdown time 
purely to shut the client down again, and that could block or fail in some 
environments. The same applies to the ECS side. Maybe only shut the client down 
if it was actually created (e.g. track creation with a flag or hold it in an 
AtomicReference)? Not a blocker, but could be surprising in practice.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to