Ma77Ball commented on code in PR #9445:
URL: https://github.com/apache/texera/pull/9445#discussion_r4673984267
##########
amber/src/main/scala/org/apache/texera/web/resource/SyncExecutionResource.scala:
##########
@@ -153,6 +154,13 @@ class SyncExecutionResource extends LazyLogging {
s"maxOperatorResultCellCharLimit=${request.maxOperatorResultCellCharLimit}
(capped to $maxOperatorResultCellCharLimit)"
)
+ val span = TexeraTracer.tracer
Review Comment:
Added a getParentSpanId assertion to the failed-run case pinning that the
initExecutionService span nests under this one, and added a second case that
drives the catch arm with warehouseId = Some(1) and asserts the span carries an
exception event and ERROR status; the testing section now names these two cases
and their CI run.
##########
amber/src/main/scala/org/apache/texera/web/resource/SyncExecutionResource.scala:
##########
@@ -353,11 +362,24 @@ class SyncExecutionResource extends LazyLogging {
compilationErrors = None,
errors = if (fatalErrors.nonEmpty) Some(fatalErrors) else None
)
+ }
- } catch {
- case e: Exception =>
- logger.error(s"Sync execution error: ${e.getMessage}", e)
- handleExecutionError(e)
+ try {
+ // A failed run (an early return or a caught exception) must mark the
span ERROR, or
+ // Jaeger's error filter skips it; set it once from the single result.
+ val result =
+ try runExecution()
+ catch {
+ case e: Exception =>
+ logger.error(s"Sync execution error: ${e.getMessage}", e)
+ span.recordException(e)
+ handleExecutionError(e)
+ }
+ if (!result.success) span.setStatus(StatusCode.ERROR)
+ result
+ } finally {
Review Comment:
Widened the outer catch to case t: Throwable, which records the exception,
sets the span ERROR, and rethrows, so an Error such as OutOfMemoryError no
longer ends the span UNSET.
##########
common/observability/src/main/scala/org/apache/texera/observability/SpanAttrs.scala:
##########
@@ -35,4 +35,7 @@ object SpanAttrs {
val WorkflowId: AttributeKey[java.lang.Long] =
AttributeKey.longKey("texera.workflow.id")
val ExecutionId: AttributeKey[java.lang.Long] =
AttributeKey.longKey("texera.execution.id")
+ val ComputingUnitId: AttributeKey[java.lang.Long] =
+ AttributeKey.longKey("texera.computing_unit.id")
Review Comment:
Added the two getKey assertions to SpanAttrsSpec pinning
texera.computing_unit.id and texera.operator.count, so renaming either string
now fails a test.
##########
amber/src/test/scala/org/apache/texera/web/resource/SyncExecutionResourceSpec.scala:
##########
@@ -1217,4 +1254,37 @@ class SyncExecutionResourceSpec
result.operators("scan-op").state shouldBe "Unknown"
result.operators("scan-op").error shouldBe None
}
+
+ it should "mark the execution span ERROR with correlation labels on a failed
run" in {
Review Comment:
Updated the class Scaladoc to say executeWorkflowSync is driven by two
end-to-end cases.
--
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]