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

DT-2686 - show last failure stack trace separately in pending activities #2521

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

rossedfort
Copy link
Contributor

@rossedfort rossedfort commented Jan 28, 2025

Description & motivation 💭

We got feedback that the stack trace on pending activity failures was difficult to interpret because it was being shown in a JSON codeblock. This PR moves the stack trace to a separate code block which is formatted correctly.

Screenshots (if applicable) 📸

before after
Screenshot 2025-01-28 at 2 14 04 PM Screenshot 2025-01-28 at 2 13 46 PM

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

  1. Create an activity that will fail
import { ApplicationFailure } from "@temporalio/common";

const failAfter = (seconds: number) => {
  return new Promise((_, reject) => {
    setTimeout(() => {
      reject();
    }, seconds * 1000);
  })
}

export const pendingFailure = async (): Promise<void> => {
  try {
    await failAfter(5);
  } catch {
    throw new ApplicationFailure('Error', 'unknown', false, ['Foo', 'Bar', 42]);
  }
}
  1. Define a workflow that executes this activity - note, do not specify maximumAttempts so the activity can fail endlessly. Also specify a high enough startToCloseTimeout to be able to test
const {
  pendingFailure,
} = proxyActivities<typeof activities>({
  retry: {
    initialInterval: '50 milliseconds',
  },
  startToCloseTimeout: '1 day',
});
  1. Run the workflow, view the Pending Activities tab for the resulting workflow execution, and verify changes.

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 28, 2025 9:33pm

@rossedfort rossedfort merged commit 03f1eb9 into main Jan 28, 2025
15 checks passed
@rossedfort rossedfort deleted the DT-2686-pending-activities-stack-trace branch January 28, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants