Skip to content

fix(amber, operator): keep error information on three failure paths - #7804

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:fix/preserve-error-information
Aug 20, 2026
Merged

fix(amber, operator): keep error information on three failure paths#7804
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:fix/preserve-error-information

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Three error paths that silently lost the information they exist to surface. All were characterized during earlier coverage work and deliberately left unpinned so a fix would not have to fight a test asserting the broken behaviour.

1. OPVersion.getVersion no longer returns null when git log fails. The GitAPIException catch now stores the same "N/A" sentinel its NullPointerException sibling already did, so the result is non-null and memoized — previously the trailing opMap.get(operatorName) handed back null, which propagated into operator metadata (LogicalOp.scala:462-466OperatorMetadataGenerator.scala:171), and every later call re-ran the failing git log. printStackTrace() is kept.

That "N/A" is the intended sentinel is corroborated downstream: agent-service/src/agent/util/workflow-utils.ts:193 already defends with ?? "N/A".

2. InputManager.startInputPortReaderThreads now passes the cause. It wrapped a start failure as new RuntimeException(s"…: ${e.getMessage}") without e, discarding the original stack trace. The reader thread itself already does this correctly (InputPortMaterializationReaderThread.scala:147).

3. PekkoActorRefMappingService.retrieveActorRef's catch no longer re-reads the failing value. It bound e but never used it, instead reading actorService.parent again to name the parent in its warning — so a persistently unreachable parent threw straight out of the handler meant to contain it. The message now omits the parent and passes e as the log throwable, matching house style (WorkflowActor.scala:144, SyncExecutionResource.scala:705).

Why not hoist the read instead: capturing the parent ref before the try was considered and rejected — the read is what throws, so hoisting it would let the failure escape retrieveActorRef entirely rather than fixing anything.

All three are pinned, verified in both directions

The production files were reverted and restored to confirm each test actually fails without its fix:

Suite production reverted with fixes
OPVersionSpec 9 passed, 2 failed 11 passed
InputManagerSpec + PekkoActorRefMappingServiceSpec 20 passed, 2 failed 22 passed

The before-state failures are the right ones:

  • null was not equal to "N/A" (both new OPVersion cases)
  • null equaled null the original failure must be attached as the cause
  • java.lang.IllegalStateException: parent is unreachable at … PekkoActorRefMappingService.retrieveActorRef — i.e. thrown out of the handler, exactly the predicted failure mode

On the tests

  • OPVersion: two cases using the existing unborn-HEAD throwaway-repo technique — the "N/A" fallback, and that it is memoized so a failing git log is not retried.
  • InputManager: a NoOpReaderThread subclass (no-op run(), so no storage is touched) is started and joined, then installed into the private map by reflection — the same technique as the existing OutputPortStorageWriterThreadSpec.installWriterThread. Thread.start() on a TERMINATED thread then throws IllegalThreadStateException deterministically, and the test asserts both the wrapping message and that getCause is that exception.
  • PekkoActorRefMappingService: the new case sets the failure counter to Int.MaxValue so every read throws, not just the first — the existing single-failure test could not have caught this. It also asserts the id remains askable afterwards, i.e. was not wrongly marked queried.

Three stale comments were updated rather than left contradicting the new assertions: OPVersionSpec's "Deliberately NOT asserted" paragraph about the null, and the defect notes on the two amber specs.

Verification

  • OPVersionSpec 11/11; InputManagerSpec + PekkoActorRefMappingServiceSpec + InputPortMaterializationReaderThreadSpec 32/32 (the reader-thread spec included as the nearest neighbour to the InputManager change).
  • Specs were filtered deliberately rather than running the whole WorkflowOperator module, because FileScanSourceOpExecSpec currently aborts on Windows over a leaked handle — that is being fixed separately in fix(test): stop the file-handle leak aborting the operator suite, seed the interval spec #7800.
  • scalafmtCheck, Test/scalafmtCheck and scalafixAll --check pass for both modules. One pre-existing scalafix warning in an untouched file (OutputManagerSpec.scala:59, unused suppression) is unrelated.

Any related issues, documentation, discussions?

Closes #7803

How was this PR tested?

sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.metadata.OPVersionSpec" "WorkflowExecutionService/testOnly org.apache.texera.amber.engine.architecture.messaginglayer.InputManagerSpec org.apache.texera.amber.engine.architecture.common.PekkoActorRefMappingServiceSpec"
[info] Tests: succeeded 11, failed 0, canceled 0, ignored 0, pending 0
[info] Tests: succeeded 22, failed 0, canceled 0, ignored 0, pending 0

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5)

Copilot AI lite review requested due to automatic review settings August 20, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 20, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 20, 2026 05:39
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Yicong-Huang
    You can notify them by mentioning @Yicong-Huang in a comment.

@codecov-commenter

codecov-commenter commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (c8b9495) to head (490f658).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7804      +/-   ##
============================================
- Coverage     91.34%   91.33%   -0.01%     
+ Complexity     4479     4476       -3     
============================================
  Files          1171     1171              
  Lines         47199    47201       +2     
  Branches       5303     5303              
============================================
- Hits          43114    43113       -1     
  Misses         2428     2428              
- Partials       1657     1660       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø)
agent-service 98.62% <ø> (ø) Carriedforward from c8b9495
amber 88.08% <100.00%> (-0.02%) ⬇️
computing-unit-managing-service 73.67% <ø> (ø)
config-service 86.73% <ø> (ø)
file-service 68.90% <ø> (ø)
frontend 92.84% <ø> (ø) Carriedforward from c8b9495
notebook-migration-service 79.13% <ø> (ø)
pyamber 97.57% <ø> (ø) Carriedforward from c8b9495
workflow-compiling-service 77.19% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 5 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main 875aa72 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 379 0.232 25,990/48,539/48,539 us 🔴 +21.8% / 🔴 +211.3%
bs=100 sw=10 sl=64 857 0.523 116,616/133,069/133,069 us ⚪ within ±5% / 🔴 +24.6%
bs=1000 sw=10 sl=64 963 0.587 1,037,457/1,097,329/1,097,329 us ⚪ within ±5% / 🔴 +8.3%
Baseline details

Latest main 875aa72 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 379 tuples/sec 419 tuples/sec 771.02 tuples/sec -9.5% -50.8%
bs=10 sw=10 sl=64 MB/s 0.232 MB/s 0.256 MB/s 0.471 MB/s -9.4% -50.7%
bs=10 sw=10 sl=64 p50 25,990 us 22,046 us 12,749 us +17.9% +103.9%
bs=10 sw=10 sl=64 p95 48,539 us 39,860 us 15,594 us +21.8% +211.3%
bs=10 sw=10 sl=64 p99 48,539 us 39,860 us 19,320 us +21.8% +151.2%
bs=100 sw=10 sl=64 throughput 857 tuples/sec 877 tuples/sec 997.05 tuples/sec -2.3% -14.0%
bs=100 sw=10 sl=64 MB/s 0.523 MB/s 0.535 MB/s 0.609 MB/s -2.2% -14.1%
bs=100 sw=10 sl=64 p50 116,616 us 113,078 us 100,339 us +3.1% +16.2%
bs=100 sw=10 sl=64 p95 133,069 us 139,629 us 106,781 us -4.7% +24.6%
bs=100 sw=10 sl=64 p99 133,069 us 139,629 us 113,101 us -4.7% +17.7%
bs=1000 sw=10 sl=64 throughput 963 tuples/sec 963 tuples/sec 1,037 tuples/sec 0.0% -7.2%
bs=1000 sw=10 sl=64 MB/s 0.587 MB/s 0.588 MB/s 0.633 MB/s -0.2% -7.3%
bs=1000 sw=10 sl=64 p50 1,037,457 us 1,038,925 us 971,388 us -0.1% +6.8%
bs=1000 sw=10 sl=64 p95 1,097,329 us 1,083,990 us 1,013,249 us +1.2% +8.3%
bs=1000 sw=10 sl=64 p99 1,097,329 us 1,083,990 us 1,039,879 us +1.2% +5.5%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,527.29,200,128000,379,0.232,25990.30,48538.92,48538.92
1,100,10,64,20,2334.98,2000,1280000,857,0.523,116616.09,133069.29,133069.29
2,1000,10,64,20,20778.94,20000,12800000,963,0.587,1037456.62,1097329.45,1097329.45

@xuang7 xuang7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 20, 2026
Merged via the queue into apache:main with commit 226124b Aug 20, 2026
59 of 65 checks passed
@aglinxinyuan
aglinxinyuan deleted the fix/preserve-error-information branch August 20, 2026 20:00
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened: draft #7809 (#7809) to release/v1.2, assigned to @aglinxinyuan — needs manual work because the cherry-pick conflicts.

aglinxinyuan added a commit that referenced this pull request Aug 20, 2026
The cherry-pick of #7804 hit modify/delete on all three of its spec files:
each already existed on `main` (added by #7018, #7219 and #5451, none of
which were backported) but is absent here, so git could not apply a diff
and the automation committed `main`'s whole file. Two of the three compile
and pass against this branch unchanged; `PekkoActorRefMappingServiceSpec`
does not, because it is written against `main` names this branch predates:

  - `virtualidentity.util.COORDINATOR` is `CONTROLLER` here, so the import
    did not resolve at all;
  - the scaladoc pointed at `PekkoMessageTransferServiceSpec`, a sibling
    that does not exist on this branch, leaving a dangling `[[link]]`.

The assertions are untouched: every method the suite drives is identical
on this branch, and the production hunks of #7804 applied cleanly.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine fix release/v1.2 back porting to release/v1.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Three error paths lose information: a null version, a dropped cause, and a self-referencing handler

5 participants