pjfanning opened a new pull request, #911:
URL: https://github.com/apache/pekko-management/pull/911

   M8 — API token caching: Changed apiToken() from a def (line 80) to a lazy 
val (line 80). The token is now read from the filesystem once on first access 
and reused for all subsequent requests. headers() references the cached 
apiToken future instead of calling the method each time.
   
   M9 — Connection leak on timeout: Replaced Future.firstCompletedOf with a 
Promise-based approach. Both the response and timeout write to the same promise 
via trySuccess/tryFailure. When the timeout fires first, it calls 
response.foreach(_.discardEntityBytes()) to consume the response entity if one 
arrives later, preventing the HTTP connection from leaking. The promise-based 
approach avoids the race condition where firstCompletedOf abandons the slower 
future without cleanup.
   
   L6 — DateTimeFormatter on every heartbeat: Added UTC_FORMATTER as a val in 
the companion object (NativeKubernetesApiImpl.scala:43) that caches 
RFC3339MICRO_FORMATTER.withZone(ZoneId.of("UTC")). The currentTimeRFC3339 
method now uses this cached formatter instead of calling .withZone on every 
heartbeat.
   
   L7 — Silent Acquire drop: In LeaseActor.scala:247, the whenUnhandled Acquire 
handler now sends InvalidRequest("Tried to acquire a lease while previous 
acquire/release still in progress") to the sender, matching the behavior of the 
Release handler. Previously it logged but never replied, leaving the caller 
hanging.


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