Remove Sentry instrumentWorkflowWithSentry to resolve workflow timeouts#51
Open
punitarani wants to merge 1 commit intomainfrom
Open
Remove Sentry instrumentWorkflowWithSentry to resolve workflow timeouts#51punitarani wants to merge 1 commit intomainfrom
punitarani wants to merge 1 commit intomainfrom
Conversation
…imeouts Sentry's instrumentWorkflowWithSentry wrapper was interfering with Cloudflare Workers workflow step execution, causing steps to hang and time out despite quick underlying API calls. Root Cause: - Sentry's workflow instrumentation creates additional overhead that doesn't properly serialize/deserialize across workflow hibernation cycles - Cloudflare Workflows hibernate and resume, re-executing the run() method - This can cause spans to duplicate or timeout when workflow context is lost and restored Solution: - Removed instrumentWorkflowWithSentry from all three workflows: * ProcessSeatsAeroSearchWorkflow * ProcessFlightAlertsWorkflow * CheckFlightAlertsWorkflow - Preserved all Sentry monitoring capabilities: * captureException() for error tracking (within steps) * addBreadcrumb() for execution trails * setUser() and setTag() for context * workerLogger for structured logging * withSentry wrapper at handler level (index.ts) * withSentryMonitor for cron check-in tracking (CheckFlightAlertsWorkflow) Benefits: ✅ Workflows execute without instrumentation overhead ✅ All errors still captured via captureException calls within steps ✅ Breadcrumbs provide execution trail ✅ Cron monitoring still works via withSentryMonitor ✅ HTTP handler monitoring via withSentry in index.ts ✅ No interference with workflow hibernation/resumption All tests pass (43/43 worker tests)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sentry's instrumentWorkflowWithSentry wrapper was interfering with Cloudflare Workers workflow step execution, causing steps to hang and time out despite quick underlying API calls.
Root Cause:
Solution:
Benefits:
✅ Workflows execute without instrumentation overhead ✅ All errors still captured via captureException calls within steps ✅ Breadcrumbs provide execution trail
✅ Cron monitoring still works via withSentryMonitor ✅ HTTP handler monitoring via withSentry in index.ts ✅ No interference with workflow hibernation/resumption
All tests pass (43/43 worker tests)