Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only end the span if it exists #9938

Merged
merged 1 commit into from
May 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .werft/util/werft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ export class Werft {
*/
public fail(slice, err) {
const span = this.sliceSpans[slice];

if (span) {
span.end()
} else {
console.log(`[${slice}] tracing warning: No slice span by name ${slice}`)
}

// Set the status on the span for the slice and also propagate the status to the phase and root span
// as well so we can query on all phases that had an error regardless of which slice produced the error.
[span, this.rootSpan, this.currentPhaseSpan].forEach((span: Span) => {
Expand All @@ -83,8 +90,6 @@ export class Werft {
})
})

span.end()

console.log(`[${slice}|FAIL] ${err}`);
throw err;
}
Expand Down