Skip to content

Fixes for internal error reattempts #1436

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

Merged
merged 17 commits into from
Oct 28, 2024
Merged

Fixes for internal error reattempts #1436

merged 17 commits into from
Oct 28, 2024

Conversation

nicktrn
Copy link
Collaborator

@nicktrn nicktrn commented Oct 28, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced error handling for task runs, including clearer error messages and improved response to specific error scenarios.
    • Introduction of the UpdateFatalRunErrorService to manage fatal errors effectively.
  • Bug Fixes

    • Streamlined error codes for various task statuses, improving consistency and maintainability.
  • Documentation

    • Added comments and clarifications in the codebase to improve understanding of error codes and handling logic.
  • Refactor

    • Simplified method signatures and logic across several services to enhance clarity and maintainability.

Copy link

changeset-bot bot commented Oct 28, 2024

⚠️ No Changeset found

Latest commit: c444f2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 28, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Files that changed from the base of the PR and between 98b4b1f and c444f2d.

📒 Files selected for processing (1)
  • apps/webapp/app/v3/services/updateFatalRunError.server.ts (1 hunks)
_______________________________________
< CI/CD: Code Inspection/Catch Defects. >
---------------------------------------
 \
  \   \
       \ /\
       ( )
     .( o ).

Walkthrough

The pull request introduces several modifications across multiple files, primarily focusing on enhancing error handling and control flow in task management and monitoring services. Key changes include the introduction of new error codes, improvements in the handling of task run statuses, and updates to message schemas to support additional features. The TaskMonitor class's error handling logic is refined, and new services are added to manage fatal errors more effectively. Overall, the changes aim to streamline error reporting and improve the responsiveness of the system to various task states.

Changes

File Path Change Summary
apps/kubernetes-provider/src/taskMonitor.ts Modified TaskMonitor class for error handling; introduced onlyOverrideExistingError and updated handling of "OOMKilled".
apps/webapp/app/components/runs/v3/SpanEvents.tsx Updated SpanEventError to conditionally render Feedback or Callout based on enhancedException.link.magic.
apps/webapp/app/models/taskRun.server.ts Enhanced error handling with TaskRunErrorCodes; updated error codes for canceled and incorrectly configured task runs.
apps/webapp/app/v3/failedTaskRun.server.ts Refactored call method in FailedTaskRunRetryHelper; updated DEFAULT_RETRY_CONFIG_SINCE_VERSION.
apps/webapp/app/v3/handleSocketIo.server.ts Enhanced error handling in socket.io server; updated handlers for TASK_RUN_COMPLETED, WORKER_CRASHED, and INDEXING_FAILED.
apps/webapp/app/v3/requeueTaskRun.server.ts Updated call method to use TaskRunErrorCodes for INTERNAL_ERROR.
apps/webapp/app/v3/services/completeAttempt.server.ts Introduced CompleteAttemptServiceOptions; refactored call method for better configurability and error handling.
apps/webapp/app/v3/services/crashTaskRun.server.ts Updated error handling to use TaskRunErrorCodes; added checks for overrideCompletion.
apps/webapp/app/v3/services/updateFatalRunError.server.ts Introduced UpdateFatalRunErrorService to handle fatal error updates for task runs.
packages/cli-v3/src/entryPoints/deploy-run-controller.ts Modified #submitAttemptCompletion method to simplify exit code determination.
packages/core/src/v3/apps/process.ts Added comments for EXIT_CODE_ALREADY_HANDLED and updated comments for EXIT_CODE_CHILD_NONZERO.
packages/core/src/v3/errors.ts Updated shouldRetryError function to handle TASK_RUN_HEARTBEAT_TIMEOUT and TASK_PROCESS_SIGTERM differently.
packages/core/src/v3/runtime/noopRuntimeManager.ts Updated waitForTask method to use TaskRunErrorCodes for error handling.
packages/core/src/v3/schemas/messages.ts Enhanced message schemas with optional fields for better error handling and versioning support.

Possibly related PRs

Suggested reviewers

  • ericallam

🐰 In the meadow, hops a little hare,
With changes in code, we dance without care.
Errors now clearer, with codes that align,
Task runs will flourish, oh how they will shine!
So let’s celebrate this code, oh so bright,
For every small fix brings a hop of delight! 🌼✨

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting in your project's settings in CodeRabbit to disable sequence diagrams in the walkthrough.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Outside diff range and nitpick comments (6)
apps/webapp/app/components/runs/v3/SpanEvents.tsx (1)

83-100: LGTM: Well-implemented error handling UI with clear user feedback paths.

The conditional rendering provides appropriate UI components based on the error context. The implementation aligns well with the PR's objective of improving error handling.

Minor suggestion: Consider consolidating the Button styling props into a preset variant to improve reusability.

+// In your button component or styles file
+const BUTTON_VARIANTS = {
+  contactForm: {
+    variant: "tertiary/medium",
+    leadingIconClassName: "text-blue-400",
+    fullWidth: true,
+    textAlignLeft: true,
+  },
+};

-<Button
-  variant="tertiary/medium"
-  LeadingIcon={EnvelopeIcon}
-  leadingIconClassName="text-blue-400"
-  fullWidth
-  textAlignLeft
->
+<Button
+  {...BUTTON_VARIANTS.contactForm}
+  LeadingIcon={EnvelopeIcon}
+>
apps/webapp/app/v3/services/crashTaskRun.server.ts (1)

32-35: Enhance the deprecation warning message.

While adding a deprecation warning is good practice, consider:

  1. Including guidance on the recommended alternative
  2. Adding a deprecation timeline
  3. Considering whether an immediate return is the best approach, as it might lead to silent failures

Consider updating the warning message:

-      logger.error("CrashTaskRunService.call: overrideCompletion is deprecated", { runId });
+      logger.error(
+        "CrashTaskRunService.call: overrideCompletion option is deprecated and will be removed in v4. " +
+        "Please use the new error handling mechanism instead.", 
+        { runId }
+      );
apps/kubernetes-provider/src/taskMonitor.ts (1)

Line range hint 163-203: Consider adding error metrics and structured logging.

While the error handling is comprehensive, adding metrics and structured logging would help with monitoring and debugging:

  1. Track frequency of different error types (OOMKilled, Evicted, etc.)
  2. Monitor override patterns
  3. Log memory/disk usage trends

This would help identify systemic issues and optimize resource allocation.

Would you like me to provide an example implementation using a metrics library?

packages/core/src/v3/errors.ts (1)

169-169: Add user-friendly message for TASK_RUN_HEARTBEAT_TIMEOUT

While making heartbeat timeout non-retryable is correct, we should add an entry in prettyInternalErrors to provide clear feedback to users about what happened and how to resolve it.

Add this entry to the prettyInternalErrors object:

const prettyInternalErrors: Partial<Record<TaskRunInternalError["code"], {
    message: string;
    link?: ErrorLink;
}>> = {
+  TASK_RUN_HEARTBEAT_TIMEOUT: {
+    message: "The task failed to send heartbeat signals within the expected timeframe. This could indicate that the task was blocked or running too slowly.",
+    link: {
+      name: "Task Monitoring",
+      href: links.docs.tasks.monitoring
+    }
+  },
   // ... existing entries
};
apps/webapp/app/v3/services/completeAttempt.server.ts (2)

39-44: Ensure Proper Documentation for New Options

The newly introduced CompleteAttemptServiceOptions type includes optional parameters supportsRetryCheckpoints, isSystemFailure, and isCrash. Please ensure that these options are well-documented, including their default values and the effects they have on the service's behavior.


Line range hint 561-572: Enhance Error Handling for Checkpoint Creation Failure

When checkpoint creation fails:

...

Consider providing more detailed error information or implementing a retry mechanism for checkpoint creation failures. This can aid in debugging and potentially recover from transient issues.

Would you like assistance in enhancing the error handling logic for checkpoint creation failures?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between cbe5170 and 98b4b1f.

📒 Files selected for processing (14)
  • apps/kubernetes-provider/src/taskMonitor.ts (3 hunks)
  • apps/webapp/app/components/runs/v3/SpanEvents.tsx (2 hunks)
  • apps/webapp/app/models/taskRun.server.ts (3 hunks)
  • apps/webapp/app/v3/failedTaskRun.server.ts (2 hunks)
  • apps/webapp/app/v3/handleSocketIo.server.ts (3 hunks)
  • apps/webapp/app/v3/requeueTaskRun.server.ts (2 hunks)
  • apps/webapp/app/v3/services/completeAttempt.server.ts (13 hunks)
  • apps/webapp/app/v3/services/crashTaskRun.server.ts (6 hunks)
  • apps/webapp/app/v3/services/updateFatalRunError.server.ts (1 hunks)
  • packages/cli-v3/src/entryPoints/deploy-run-controller.ts (1 hunks)
  • packages/core/src/v3/apps/process.ts (1 hunks)
  • packages/core/src/v3/errors.ts (2 hunks)
  • packages/core/src/v3/runtime/noopRuntimeManager.ts (2 hunks)
  • packages/core/src/v3/schemas/messages.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/core/src/v3/apps/process.ts
🔇 Additional comments (22)
packages/core/src/v3/runtime/noopRuntimeManager.ts (2)

4-4: LGTM!

Clean addition of TaskRunErrorCodes import that aligns with the PR's objective of standardizing error handling across the codebase.


26-29: Verify error type consistency with error code

The error type "INTERNAL_ERROR" seems inconsistent with the error code CONFIGURED_INCORRECTLY. Consider using a more appropriate error type that better reflects the configuration-related nature of the error, or verify if this combination is intentional.

Let's check how these error types and codes are used together elsewhere:

✅ Verification successful

Let me gather more context about the error types used with this error code:


Let me search specifically for error type definitions to understand the error type system better:


Based on the code analysis, I can now generate the final response:

Error type and code combination is correct

The error type "INTERNAL_ERROR" with error code CONFIGURED_INCORRECTLY is a valid and intentional combination in the codebase. This is evident from:

  1. The error code CONFIGURED_INCORRECTLY is defined in the TaskRunErrorCodes enum and is consistently used with "INTERNAL_ERROR" type across multiple files.
  2. The error handling logic in errors.ts specifically handles this combination in the shouldRetryError function, where CONFIGURED_INCORRECTLY is treated as a non-retryable internal error.
  3. This pattern is used consistently in other files like deploy-run-worker.ts and taskRun.server.ts.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of CONFIGURED_INCORRECTLY to verify the error type pattern
rg -A 2 "CONFIGURED_INCORRECTLY" 

# Search for similar error objects to understand the pattern
ast-grep --pattern 'error: {
  type: $_,
  code: TaskRunErrorCodes.$_
}'

Length of output: 1260


Script:

#!/bin/bash
# Search for error type patterns with CONFIGURED_INCORRECTLY
rg -B 2 -A 2 'CONFIGURED_INCORRECTLY' --type ts

# Search for error type declarations/interfaces
ast-grep --pattern 'type: $_'

Length of output: 16089


Script:

#!/bin/bash
# Search for error type definitions and interfaces
rg -B 3 -A 3 'type.*Error' --type ts

# Look for the specific error handling in the errors.ts file
cat packages/core/src/v3/errors.ts

Length of output: 47715

apps/webapp/app/components/runs/v3/SpanEvents.tsx (1)

1-1: LGTM: Import statements are well-organized and support the new error handling UI.

The new imports are properly organized and necessary for the enhanced error handling UI components.

Also applies to: 9-10

apps/webapp/app/v3/requeueTaskRun.server.ts (2)

10-10: LGTM! Good practice using centralized error codes.

The addition of TaskRunErrorCodes import aligns with the PR's objective to improve error handling consistency.


63-63: Verify consistent usage of TASK_RUN_HEARTBEAT_TIMEOUT across the codebase.

The change from string literal to TaskRunErrorCodes.TASK_RUN_HEARTBEAT_TIMEOUT is good. Let's ensure this constant is used consistently for all heartbeat timeout scenarios.

✅ Verification successful

Let me gather more information about the error code definition and its usage pattern.


Based on the gathered information, I can now generate the final response:

TASK_RUN_HEARTBEAT_TIMEOUT usage is consistent across the codebase

The constant is properly defined in the schema and used consistently in error handling. The only instances found are:

  • Definition in packages/core/src/v3/schemas/common.ts
  • Error handling case in packages/core/src/v3/errors.ts
  • Usage in apps/webapp/app/v3/requeueTaskRun.server.ts

No hardcoded string variants of this error code were found, and it's the only timeout-related task run error code in use, indicating proper standardization.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining hardcoded heartbeat timeout strings and verify consistent usage of the constant

# Test 1: Look for any remaining hardcoded strings
echo "Checking for hardcoded timeout strings..."
rg -i "heartbeat.*timeout" --type ts

# Test 2: Check usage of the constant
echo "Checking usage of TaskRunErrorCodes.TASK_RUN_HEARTBEAT_TIMEOUT..."
rg "TaskRunErrorCodes\.TASK_RUN_HEARTBEAT_TIMEOUT" --type ts

Length of output: 1852


Script:

#!/bin/bash
# Check the definition and usage context of TaskRunErrorCodes

# Look for the enum/type definition
echo "Checking TaskRunErrorCodes definition..."
ast-grep --pattern 'export $_ TaskRunErrorCodes = $$$'

# Look for error handling patterns around heartbeat timeout
echo "Checking error handling patterns..."
rg "TASK_RUN_HEARTBEAT_TIMEOUT" -B 2 -A 2 --type ts

# Look for similar error codes in the enum
echo "Checking similar error codes..."
rg "TASK_RUN_.*_TIMEOUT" --type ts

Length of output: 5516

apps/webapp/app/models/taskRun.server.ts (3)

6-6: LGTM! Good practice to import error code constants.

The addition of TaskRunErrorCodes import supports the standardization of error handling across the application.


65-65: LGTM! Appropriate use of TaskRunErrorCodes constant.

The replacement of the string literal with TaskRunErrorCodes.TASK_RUN_CANCELLED improves code maintainability and type safety.


97-97: ⚠️ Potential issue

Consider using a more appropriate error code for parsing failures.

The CONFIGURED_INCORRECTLY error code is being used when parsing the error from a failed task run attempt. This might not accurately represent the nature of the error, as it's a parsing failure rather than a configuration issue. Consider using a more semantically appropriate error code like PARSE_ERROR or INVALID_ERROR_FORMAT if available in TaskRunErrorCodes.

Let's check available error codes:

apps/webapp/app/v3/services/crashTaskRun.server.ts (3)

7-7: LGTM! Good standardization of error codes.

The addition of TaskRunErrorCodes import helps centralize and standardize error handling across the application.

Also applies to: 7-7


67-67: LGTM! Good error code handling.

The use of nullish coalescing with TaskRunErrorCodes provides a clean fallback mechanism while maintaining type safety.


Line range hint 1-201: Verify consistent error handling across related services.

Since this service is part of a broader error handling system, let's verify that related services use consistent error codes and patterns.

✅ Verification successful

Based on the shell script results, I can now generate the final response as the verification is complete. The results show consistent error handling patterns across related services:

Error handling is consistent across related services

The error handling implementation shows consistent patterns across services:

  • All services use the same TaskRunErrorCodes enum for error codes
  • Consistent error structure with type: "INTERNAL_ERROR" and matching fields (code, message, stackTrace)
  • Proper fallback handling with ?? operator for error codes
  • Related services (UpdateFatalRunError, CompleteAttempt) follow the same patterns
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other services using TaskRunErrorCodes
echo "Checking TaskRunErrorCodes usage across services:"
rg "TaskRunErrorCodes\." "apps/webapp/app/v3/services" -A 2

echo "\nChecking for potential inconsistent error handling:"
rg "type:\s*['\"]INTERNAL_ERROR['\"]" "apps/webapp/app/v3/services" -A 2

Length of output: 3649

apps/webapp/app/v3/failedTaskRun.server.ts (2)

115-123: Verify the relationship between isSystemFailure and isCrash flags.

The current implementation sets isSystemFailure: !isCrash, making them mutually exclusive. This means:

  • When isCrash=true, then isSystemFailure=false
  • When isCrash=false, then isSystemFailure=true
  • When isCrash=undefined, then isSystemFailure=true

Please verify if this is the intended behavior, especially for the undefined case.

Consider adding a comment explaining the relationship between these flags and their impact on the retry behavior.


275-275: Verify the impact of SDK version requirement change.

The SDK version requirement has been increased from "3.0.14" to "3.1.0". This change means that more SDK versions will receive the warning "SDK version not recent enough to determine retry config" and potentially have different retry behavior.

Consider:

  1. Adding a changelog entry for this breaking change
  2. Documenting the retry behavior differences between SDK versions
  3. Adding migration guidance for users on SDK versions between 3.0.14 and 3.1.0

Run this script to assess the impact:

✅ Verification successful

Let me analyze the results to verify the impact of the SDK version change:

  1. The version change affects the retry configuration behavior in failedTaskRun.server.ts
  2. The code shows that if SDK version < "3.1.0", it logs a warning and won't populate retry.default
  3. Looking at the codebase:
    • RetryConfig is stored in the database schema
    • It's used in background worker tasks
    • The retry configuration is passed through the API
    • The change only affects the default retry behavior, not custom retry configs

Let me verify one more aspect about the retry configuration usage:


Based on the search results, I can verify the impact of the SDK version change:

  1. The version change from "3.0.14" to "3.1.0" affects the retry configuration behavior in failedTaskRun.server.ts
  2. The code shows that if SDK version < "3.1.0", it logs a warning "SDK version not recent enough to determine retry config" and won't populate retry.default
  3. The retry configuration is stored in the database schema and used in background worker tasks
  4. The change only affects the default retry behavior, not custom retry configs
  5. The retry configuration is passed through the API and stored in JSON format

Version update is safe and properly documented

The version requirement change from "3.0.14" to "3.1.0" is safe because:

  1. It only affects the default retry behavior
  2. The warning message clearly indicates when an SDK version is too old
  3. Custom retry configurations are unaffected
  4. The change is properly tracked in the database schema
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find potential impacts of the SDK version change
# Look for SDK version references and retry configurations

# Check for SDK version references
echo "Searching for SDK version references:"
rg -A 2 "sdkVersion|3\.0\.14|3\.1\.0"

# Check for retry configuration usage
echo "Searching for retry configuration patterns:"
rg "retry\.default|retryConfig"

Length of output: 40738


Script:

#!/bin/bash
# Search for retry.default usage and retry configuration documentation
echo "Searching for retry.default usage:"
rg -A 3 "retry\.default"

echo "Searching for retry configuration documentation:"
fd -t f "README|CHANGELOG" -x cat {}

Length of output: 162969

apps/kubernetes-provider/src/taskMonitor.ts (2)

164-165: LGTM! Clear and descriptive variable naming.

The new variable name onlyOverrideExistingError better describes its purpose compared to the previous overrideCompletion. The comment also clearly explains that this will only override existing task errors without crashing the run.


203-203: LGTM! Consistent variable usage.

The failureInfo object correctly uses the renamed variable onlyOverrideExistingError.

packages/core/src/v3/errors.ts (1)

182-182: LGTM: TASK_PROCESS_SIGTERM as retryable error

Moving TASK_PROCESS_SIGTERM to the retryable errors section is appropriate. Since SIGTERM can occur due to temporary issues (like system maintenance or resource constraints), allowing retries gives tasks a chance to complete successfully on subsequent attempts. This aligns with the existing error message that indicates uncertainty about the cause.

packages/cli-v3/src/entryPoints/deploy-run-controller.ts (1)

522-527: LGTM! Clean refactoring of exit code logic.

The introduction of isNonZeroExitError improves readability by clearly encapsulating the condition for non-zero exit codes. The logic correctly identifies internal errors with non-zero exit codes using the TaskRunErrorCodes enum.

apps/webapp/app/v3/services/updateFatalRunError.server.ts (1)

39-46: Confirm the logic for non-fatal taskRun statuses

The method returns when the taskRun is not in a fatal state. Verify that this behavior aligns with the intended workflow. If updates are only applicable to fatal task runs, consider documenting this explicitly for clarity.

apps/webapp/app/v3/services/completeAttempt.server.ts (3)

225-242: Verify the Execution Retry Inference Logic

The logic for inferring executionRetry based on isCrash or isSystemFailure flags adds complexity:

Please verify that this inference correctly handles all scenarios, especially when neither isCrash nor isSystemFailure is true. Edge cases might lead to unexpected retries or missed retries.


246-259: Ensure Correct Handling of executionRetryInferred

Passing executionRetryInferred to the #retryAttempt method:

Ensure that the downstream methods utilize executionRetryInferred appropriately and that it does not introduce unintended side effects in the retry logic.


433-443: Validate Environment Variables in Threshold Logic

The condition that checks the executionRetry.delay against env.CHECKPOINT_THRESHOLD_IN_MS:

...

Ensure that env.CHECKPOINT_THRESHOLD_IN_MS is defined and properly populated in all environments where this code will run. Missing or misconfigured environment variables could lead to unintended behavior.

packages/core/src/v3/schemas/messages.ts (1)

255-257: LGTM: Addition of optional fields to 'WORKER_CRASHED' message schema.

The inclusion of overrideCompletion and errorCode as optional fields enhances error handling flexibility without affecting existing functionality.

Copy link

pkg-pr-new bot commented Oct 28, 2024

@trigger.dev/react-hooks

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/react-hooks@1436

@trigger.dev/sdk

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/sdk@1436

@trigger.dev/core

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/core@1436

@trigger.dev/build

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/build@1436

trigger.dev

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev@1436

commit: 98b4b1f

@nicktrn nicktrn changed the title Internal error retry related fixes Fixes for internal error reattempts Oct 28, 2024
@nicktrn nicktrn merged commit d2c779e into main Oct 28, 2024
6 of 8 checks passed
@nicktrn nicktrn deleted the fix/retry-fixes branch October 28, 2024 19:15
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.

1 participant