Repository navigation
Conversation
SyncExecutionResource.executeWorkflowSync, the POST /execution/{wid}/{cuid}/run entrypoint, ran with no span of its own, so a synchronous run produced no end-to-end trace; only the nested WorkflowService.initExecutionService span existed. executeWorkflowSync now opens a span named after the method with texera.workflow.id, texera.computing_unit.id, and texera.operator.count attributes, makes it current so initExecutionService nests beneath it, records a thrown exception on the span, and ends it in a finally so every early return and the catch path are covered. A synchronous run now yields a single trace showing total execution time with the init step as a child, using the same TexeraTracer and SpanAttrs pattern already in WorkflowService.
reference/perf-candidates.md records this under P6 as the first slice, including the note that the amber module cannot be compiled locally without JOOQ code generation against the database (an existing build requirement unrelated to this change), so the change is verified by matching the established span pattern and relies on CI to compile.
Automated Reviewer SuggestionsBased on the
|
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 380 | 0.232 | 23,203/43,625/43,625 us | 🟢 -19.1% / 🔴 +225.7% |
| 🔴 | bs=100 sw=10 sl=64 | 827 | 0.505 | 117,362/151,375/151,375 us | 🔴 -5.8% / 🔴 +75.3% |
| ⚪ | bs=1000 sw=10 sl=64 | 975 | 0.595 | 1,027,808/1,078,015/1,078,015 us | ⚪ within ±5% / 🔴 +32.7% |
Baseline details
Latest main 9647f58 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 380 tuples/sec | 415 tuples/sec | 993.83 tuples/sec | -8.4% | -61.8% |
| bs=10 sw=10 sl=64 | MB/s | 0.232 MB/s | 0.253 MB/s | 0.607 MB/s | -8.3% | -61.8% |
| bs=10 sw=10 sl=64 | p50 | 23,203 us | 21,290 us | 10,119 us | +9.0% | +129.3% |
| bs=10 sw=10 sl=64 | p95 | 43,625 us | 53,915 us | 13,394 us | -19.1% | +225.7% |
| bs=10 sw=10 sl=64 | p99 | 43,625 us | 53,915 us | 16,114 us | -19.1% | +170.7% |
| bs=100 sw=10 sl=64 | throughput | 827 tuples/sec | 878 tuples/sec | 1,327 tuples/sec | -5.8% | -37.7% |
| bs=100 sw=10 sl=64 | MB/s | 0.505 MB/s | 0.536 MB/s | 0.81 MB/s | -5.8% | -37.7% |
| bs=100 sw=10 sl=64 | p50 | 117,362 us | 111,918 us | 79,097 us | +4.9% | +48.4% |
| bs=100 sw=10 sl=64 | p95 | 151,375 us | 143,636 us | 86,335 us | +5.4% | +75.3% |
| bs=100 sw=10 sl=64 | p99 | 151,375 us | 143,636 us | 94,338 us | +5.4% | +60.5% |
| bs=1000 sw=10 sl=64 | throughput | 975 tuples/sec | 975 tuples/sec | 1,363 tuples/sec | 0.0% | -28.5% |
| bs=1000 sw=10 sl=64 | MB/s | 0.595 MB/s | 0.595 MB/s | 0.832 MB/s | 0.0% | -28.5% |
| bs=1000 sw=10 sl=64 | p50 | 1,027,808 us | 1,029,917 us | 774,633 us | -0.2% | +32.7% |
| bs=1000 sw=10 sl=64 | p95 | 1,078,015 us | 1,070,968 us | 814,584 us | +0.7% | +32.3% |
| bs=1000 sw=10 sl=64 | p99 | 1,078,015 us | 1,070,968 us | 858,914 us | +0.7% | +25.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,526.40,200,128000,380,0.232,23202.92,43625.08,43625.08
1,100,10,64,20,2418.72,2000,1280000,827,0.505,117361.54,151374.55,151374.55
2,1000,10,64,20,20515.22,20000,12800000,975,0.595,1027807.53,1078015.20,1078015.20
bobbai00
left a comment
There was a problem hiding this comment.
🔴 1 must-fix · 2 advisory · 0 polish: the span nests and ends correctly, but failed runs export as non-error spans.
Correctness (1)
SyncExecutionResource.scala:368: failed and timed-out runs never set ERROR status on the span (must-fix, see inline)
Simplifications (1)
SyncExecutionResource.scala:160: two span keys are raw strings instead ofSpanAttrsconstants (advisory, see inline)
Conventions (1)
SyncExecutionResource.scala:157: no test or performed check covers the new span (advisory, see inline)
Verification trace
Checked recordException in opentelemetry-sdk-trace 1.50.0 (SdkSpan): it adds an exception event and never sets status. Every failure exit of executeWorkflowSync (the outer catch via handleExecutionError, the timeout and wait-error returns, the null-service return, a terminal FAILED state) returns success = false, so one status check on the result covers all of them. Nesting holds: the span stays current on the request thread through the synchronous initExecutionService call, whose span builder takes the current context.
The executeWorkflowSync span recorded an exception but never set a status, so a failed run exported as UNSET and Jaeger's error filter skipped it, while the early timeout, wait-error, and null-service returns did not touch the span at all. The body is now a nested runExecution whose single result, or the failure handed back by the catch, sets the span to ERROR once when it is not successful, covering every failure path. SpanAttrs gains ComputingUnitId and OperatorCount so the span tags those with shared keys instead of inline strings. SyncExecutionResourceSpec drives a failing run and asserts, via an in-memory SpanExporter installed into GlobalOpenTelemetry, that the span is named, tagged, and marked ERROR.
5580145 to
a48464e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9445 +/- ##
============================================
- Coverage 91.79% 91.68% -0.12%
- Complexity 5022 5128 +106
============================================
Files 1283 1304 +21
Lines 56871 58091 +1220
Branches 7440 7575 +135
============================================
+ Hits 52205 53259 +1054
- Misses 2797 2923 +126
- Partials 1869 1909 +40
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bobbai00
left a comment
There was a problem hiding this comment.
🟡 2 resolved · 1 open · 3 new (3 new = 2 newly introduced · 1 late catch): failed runs now export as ERROR spans; what is left is small.
Correctness (1)
SyncExecutionResource.scala:380: anErrorskips the catch and the status line, so the span ends UNSET (advisory, see inline)
Polish: 2 quick touch-ups (see inline comments).
Still open: the test thread at SyncExecutionResource.scala:158, where nesting and the catch arm are unasserted (see the reply there).
Verification trace
Re-checked the round-1 fix at a48464e. The three early returns sit inside the nested def runExecution() and not inside a closure, so they return to the call at L371 and reach the status check at L378. handleExecutionError returns success = false on both branches, so a caught exception also ends ERROR. The new case's scan fails compilation inside initExecutionService, which stamps FAILED, so the case does reach L378. The one exit left unmarked is a non-Exception Throwable.
SyncExecutionResource.executeWorkflowSync wraps its body in an outer try whose catch now matches Throwable rather than Exception: the throwable is recorded as an "exception" event on the execution span, the span status is set to StatusCode.ERROR, and the throwable is rethrown, while the finally still closes the current-context scope and ends the span. The inner `case e: Exception` arm is unchanged and keeps turning expected engine failures into a success=false result, so the new outer arm only covers non-Exception Errors (for example OutOfMemoryError) that previously left the span UNSET. SpanAttrsSpec: the "expose stable key names" case now also asserts SpanAttrs.ComputingUnitId.getKey is "texera.computing_unit.id" and SpanAttrs.OperatorCount.getKey is "texera.operator.count", so renaming either wire key fails a test. SyncExecutionResourceSpec: the failed-run case now asserts the exported WorkflowService.initExecutionService span's parent span id equals the executeWorkflowSync span id, pinning that init nests under the sync span. A new case drives the throwing path by passing warehouseId = Some(1), which is refused before any engine run, and asserts the exported executeWorkflowSync span carries an "exception" event and ERROR status. The class Scaladoc now says the span behaviour is driven by two end-to-end cases.
bobbai00
left a comment
There was a problem hiding this comment.
🟡 3 resolved · 1 open · 1 new (1 new = 1 newly introduced · 0 late catches): the code now covers every failure path; one description phrase and one Scaladoc word remain.
Conventions (1)
SyncExecutionResource.scala:373: the description says every Throwable is re-raised; anExceptionstill returns a 200 (advisory, see inline)
Still open: the Scaladoc count thread at SyncExecutionResourceSpec.scala:1258 (a third case now calls executeWorkflowSync, see the reply there).
Verification trace
Re-checked at 3fb963e. The new outer case t: Throwable arm (L381-384) only sees non-Exception throwables, because the inner arm (L373-376) converts every Exception into a result first, so nothing is recorded twice and the endpoint's HTTP behavior matches base. The new throwing case is refused at L176 under either warehouse setting, so it reaches the inner arm without an engine run. The nesting assertion compares the init span's parent id with this span's id, and each span case clears the exporter first.
What changes were proposed in this PR?
Any related issues, documentation, discussions?
Closes: #9440
How was this PR tested?
sbt "WorkflowExecutionService/testOnly *SyncExecutionResourceSpec"(CI): the "mark the execution span ERROR with correlation labels on a failed run" case asserts the span name, the three correlation attributes, ERROR status, and that initExecutionService nests under it (its parent span id equals this span's id); the "record the exception and mark the span ERROR when the run throws" case drives the catch arm with warehouseId = Some(1) and asserts an exception event plus ERROR. The amber module cannot be compiled in this environment (its JOOQ sources are generated against an unavailable database, a pre-existing build requirement), so these two cases are verified on CI.sbt "Observability/testOnly *SpanAttrsSpec": the key-name case now also pins texera.computing_unit.id and texera.operator.count; passes locally (3 tests).Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF