mengw15 commented on code in PR #7539: URL: https://github.com/apache/texera/pull/7539#discussion_r3762467051
########## common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/result/iceberg/IcebergDocument.scala: ########## @@ -72,7 +72,10 @@ private[storage] class IcebergDocument[T >: Null <: AnyRef]( private val lock = new ReentrantReadWriteLock() - @transient lazy val catalog: Catalog = IcebergCatalogInstance.getInstance(warehouse) + // Resolved per use, never held: the catalog cache is bounded and closes evicted + // entries (#7290), so a pinned reference could outlive its catalog. A public def + // (not a lazy val) also means a replaced/rebuilt catalog is picked up immediately. + def catalog: Catalog = IcebergCatalogInstance.getInstance(warehouse) Review Comment: Done in babda0e8e — and the framing is right: per-use has to mean per logical operation, not per accessor call (the writer's `flushBuffer` already resolved once; `clear()` was the one multi-touch operation left). `clear()` now resolves a single catalog for its check-then-drop, pinned by a spec case whose fake swaps the cache entry from inside `tableExists` — the drop must still land on the catalog the operation started with. Every other method in the class resolves once per call. -- 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]
