Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PresignedUrlCache exception message for clarity #546

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update PresignedUrlCache exception message for clarity
Why:
Today, when a job doesn't access the delta table before `expireAfterAccessMs`, the presigned url is removed from the cache. When the job does try to access that table, the entry is removed from the concurrent hash map and an IllegalStateException is thrown. This exception message says the table was "removed". The message is confusing if the developer doesn't understand the table was "removed" from the cache. It is not unreasonable for the developer to be confused that the delta table was suddenly removed completely!

How this works:
This changes the exception message to carry the expireMilliseconds information in the stack trace. This should help developers understand and adjust their job configurations
  • Loading branch information
ScottReyn-db authored Aug 1, 2024
commit b7bb0cdc5af2494d08b01a60cb90ad874b30ed26
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class CachedTableManager(
fileId: String): PreSignedUrlCache.Rpc.GetPreSignedUrlResponse = {
val cachedTable = cache.get(tablePath)
if (cachedTable == null) {
throw new IllegalStateException(s"table $tablePath was removed")
throw new IllegalStateException(s"table $tablePath was removed from PresignedUrlCache. Perhaps it expired after $expireAfterAccessMs ms")
}
cachedTable.lastAccess = System.currentTimeMillis()
val url = cachedTable.idToUrl.getOrElse(fileId, {
Expand Down
Loading