You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2026/07/30 09:27:31 UTC
[PR] improve lease code [pekko-management]
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org
Re: [PR] improve lease code [pekko-management]
Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #911:
URL: https://github.com/apache/pekko-management/pull/911
--
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: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org