Skip to content

fix(amber): report an uninitialized execution, not an NPE - #7848

Open
Amer-Mukhtar wants to merge 1 commit into
apache:mainfrom
Amer-Mukhtar:fix/ws-uninitialized-execution
Open

fix(amber): report an uninitialized execution, not an NPE#7848
Amer-Mukhtar wants to merge 1 commit into
apache:mainfrom
Amer-Mukhtar:fix/ws-uninitialized-execution

Conversation

@Amer-Mukhtar

@Amer-Mukhtar Amer-Mukhtar commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Description

What changes were proposed in this PR?

In myOnMsg, the case other arm read the current execution with workflowStateOpt.map(_.executionService.getValue). executionService is a BehaviorSubject seeded with null, so map wraps that null into Some(null) and the case None arm never runs. A runtime frame arriving before an execution exists therefore fails with a NullPointerException on value.wsInput instead of the intended IllegalStateException("workflow execution is not initialized").

The arm now reads executionStateOpt, the null safe value already computed at the top of the method, so an absent execution reaches the case None arm and the intended message is produced.

The same gap in the ModifyLogicRequest branch is outside the scope of this issue and remains recorded in the spec's header comment.

Any related issues, documentation, discussions?

Closes #7454

How was this PR tested?

WorkflowWebsocketResourceSpec gains a case covering a session with a workflow attached and no execution yet, asserting the IllegalStateException, its message, and the WorkflowErrorEvent sent to the socket. The existing case with no workflow attached covers the other half of the same guard.

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

Generated-by: Claude Code

@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, @aglinxinyuan
    You can notify them by mentioning @Yicong-Huang, @aglinxinyuan in a comment.

@github-actions

github-actions Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main b7c33b0 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 387 0.236 25,642/33,720/33,720 us 🔴 +13.9% / 🔴 +124.9%
🔴 bs=100 sw=10 sl=64 901 0.55 107,672/159,472/159,472 us 🔴 +7.7% / 🔴 +50.4%
bs=1000 sw=10 sl=64 1,095 0.669 907,968/960,505/960,505 us ⚪ within ±5% / 🟢 -7.6%
Baseline details

Latest main b7c33b0 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 387 tuples/sec 442 tuples/sec 780.31 tuples/sec -12.4% -50.4%
bs=10 sw=10 sl=64 MB/s 0.236 MB/s 0.27 MB/s 0.476 MB/s -12.6% -50.4%
bs=10 sw=10 sl=64 p50 25,642 us 22,515 us 12,590 us +13.9% +103.7%
bs=10 sw=10 sl=64 p95 33,720 us 30,704 us 14,995 us +9.8% +124.9%
bs=10 sw=10 sl=64 p99 33,720 us 30,704 us 19,141 us +9.8% +76.2%
bs=100 sw=10 sl=64 throughput 901 tuples/sec 896 tuples/sec 1,006 tuples/sec +0.6% -10.4%
bs=100 sw=10 sl=64 MB/s 0.55 MB/s 0.547 MB/s 0.614 MB/s +0.5% -10.4%
bs=100 sw=10 sl=64 p50 107,672 us 111,341 us 99,387 us -3.3% +8.3%
bs=100 sw=10 sl=64 p95 159,472 us 148,109 us 106,056 us +7.7% +50.4%
bs=100 sw=10 sl=64 p99 159,472 us 148,109 us 113,689 us +7.7% +40.3%
bs=1000 sw=10 sl=64 throughput 1,095 tuples/sec 1,108 tuples/sec 1,043 tuples/sec -1.2% +5.0%
bs=1000 sw=10 sl=64 MB/s 0.669 MB/s 0.676 MB/s 0.637 MB/s -1.0% +5.1%
bs=1000 sw=10 sl=64 p50 907,968 us 903,972 us 965,215 us +0.4% -5.9%
bs=1000 sw=10 sl=64 p95 960,505 us 953,380 us 1,009,610 us +0.7% -4.9%
bs=1000 sw=10 sl=64 p99 960,505 us 953,380 us 1,039,108 us +0.7% -7.6%
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,517.23,200,128000,387,0.236,25642.37,33720.23,33720.23
1,100,10,64,20,2220.56,2000,1280000,901,0.550,107671.91,159471.93,159471.93
2,1000,10,64,20,18259.23,20000,12800000,1095,0.669,907967.81,960505.48,960505.48

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (b7c33b0) to head (918817b).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7848      +/-   ##
============================================
- Coverage     91.87%   91.86%   -0.01%     
+ Complexity     4510     4507       -3     
============================================
  Files          1173     1173              
  Lines         47350    47350              
  Branches       5306     5306              
============================================
- Hits          43502    43498       -4     
- Misses         2204     2205       +1     
- Partials       1644     1647       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from b7c33b0
agent-service 98.62% <ø> (ø) Carriedforward from b7c33b0
amber 88.35% <100.00%> (-0.03%) ⬇️
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from b7c33b0
config-service 86.73% <ø> (ø) Carriedforward from b7c33b0
file-service 75.74% <ø> (ø) Carriedforward from b7c33b0
frontend 93.79% <ø> (ø) Carriedforward from b7c33b0
notebook-migration-service 79.13% <ø> (ø) Carriedforward from b7c33b0
pyamber 97.57% <ø> (ø) Carriedforward from b7c33b0
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from b7c33b0

*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.

@Amer-Mukhtar
Amer-Mukhtar marked this pull request as ready for review August 22, 2026 12:09
@Amer-Mukhtar Amer-Mukhtar changed the title fix(amber): report an uninitialized execution, not an NPE fix(amber): report an uninitialized execution, not an NPE Aug 22, 2026
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 22, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 22, 2026 12:13
@github-actions

github-actions Bot commented Aug 22, 2026

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 Already labeled — this fix is queued to backport here.

Auto-label run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Websocket runtime commands NPE instead of reporting an uninitialized execution

3 participants