You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tryGetExistingExecution returns Some(null) instead of None for missing eid #5211
org.apache.texera.web.service.ExecutionsMetadataPersistService.tryGetExistingExecution (amber/src/main/scala/org/apache/texera/web/service/ExecutionsMetadataPersistService.scala:78) breaks the Option[T] contract for the lookup-miss case:
fetchOneByEid returns null when no row matches; that null is wrapped in Some(...) and returned. The catch only triggers on hard errors (e.g. a closed connection). Callers using getOrElse will get the null through and NPE later.
Reproduction
amber/src/test/scala/org/apache/texera/web/service/ExecutionsMetadataPersistServiceSpec.scala (introduced in the linked PR) pins this:
ExecutionsMetadataPersistService.tryGetExistingExecution(ExecutionIdentity(-1L))
// returns Some(null), not None
Activity
Ma77Ball commentedon May 26, 2026
/take
test(amber): DB-backed unit tests for ExecutionsMetadataPersistServic…
fix: honor Option contract on tryGetExistingExecution miss (apache#5221)
test(amber): DB-backed unit tests for ExecutionsMetadataPersistServic…
fix: honor Option contract on tryGetExistingExecution miss (apache#5221)