Skip to content

Conversation

@eschultink
Copy link
Member

@eschultink eschultink commented Apr 3, 2025

Fixes

  • add max TTL to cache versions, avoiding risk of stale

Change implications

  • breaking change to API? no
  • changes dependencies? no

@eschultink eschultink self-assigned this Apr 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the caching mechanism by adding a maximum TTL for caches to avoid unbounded growth.

  • Added an expiration time to the defaultVersionCache and hostnameCache.
  • Removed an obsolete getWorkerServiceHostName method in ShardedJobRunner.java.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
java/src/main/java/com/google/appengine/tools/pipeline/impl/backend/AppEngineServicesServiceImpl.java Added .expireAfterWrite(Duration.ofMinutes(10)) to caches for controlled TTL and added deprecation notices.
java/src/main/java/com/google/appengine/tools/mapreduce/impl/shardedjob/ShardedJobRunner.java Removed redundant helper method referencing the deprecated getWorkerServiceHostName.
Comments suppressed due to low confidence (2)

java/src/main/java/com/google/appengine/tools/pipeline/impl/backend/AppEngineServicesServiceImpl.java:115

  • [nitpick] Consider extracting the TTL value (Duration.ofMinutes(10)) into a named constant to avoid magic numbers and improve maintainability.
.expireAfterWrite(Duration.ofMinutes(10))

java/src/main/java/com/google/appengine/tools/pipeline/impl/backend/AppEngineServicesServiceImpl.java:121

  • [nitpick] Consider extracting the TTL value (Duration.ofMinutes(10)) into a named constant to avoid repetition and improve configurability.
.expireAfterWrite(Duration.ofMinutes(10))

@eschultink eschultink enabled auto-merge (squash) April 3, 2025 18:26
@eschultink eschultink merged commit 55c86de into main Apr 3, 2025
9 checks passed
@eschultink eschultink deleted the s196-stale-version branch April 3, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants