Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Increase isolated worker timeout to 5 min.

Type of Change

  • Other: UX Improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 28, 2026 3:29am

Request Review

@icecrasher321 icecrasher321 merged commit 8bdba37 into staging Jan 28, 2026
7 checks passed
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 28, 2026

Greptile Overview

Greptile Summary

This PR increases the fetch timeout within the isolated VM worker from 30 seconds to 5 minutes. This change allows user code executing in the isolated VM to make longer-running HTTP requests without timing out.

Key Changes:

  • FETCH_TIMEOUT_MS increased from 30000ms (30s) to 300000ms (5 min) in isolated-vm-worker.cjs:11

Context:
The fetch timeout is used when user code calls fetch() within the sandboxed execution environment. The timeout is well-aligned with the system's default execution timeout of 10 minutes (DEFAULT_EXECUTION_TIMEOUT_MS = 600000ms), allowing sufficient time for long-running API calls while still being shorter than the overall execution timeout.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it's a simple timeout constant increase
  • The change is straightforward and well-scoped. The new 5-minute fetch timeout is reasonable for long-running API calls and remains well within the 10-minute default execution timeout. The change only affects the fetch timeout within the isolated VM worker and doesn't introduce any logic changes or edge cases.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/execution/isolated-vm-worker.cjs Increased FETCH_TIMEOUT_MS from 30 seconds to 5 minutes (300000ms) to allow longer-running fetch operations within isolated VM execution

Sequence Diagram

sequenceDiagram
    participant Parent as Parent Process<br/>(isolated-vm.ts)
    participant Worker as Worker Process<br/>(isolated-vm-worker.cjs)
    participant IVM as Isolated VM Context
    participant UserCode as User Code
    
    Parent->>Worker: execute request (timeoutMs)
    activate Worker
    Note over Parent: Parent timeout = timeoutMs + 1s
    
    Worker->>IVM: Create isolate & context
    Worker->>IVM: Inject fetch callback
    
    IVM->>UserCode: Run user code (timeoutMs)
    activate UserCode
    
    UserCode->>IVM: Call fetch(url, options)
    IVM->>Worker: __fetchRef callback
    Worker->>Parent: IPC fetch request
    Note over Worker: FETCH_TIMEOUT_MS = 5 min
    
    Parent->>Parent: secureFetch (validate URL)
    Parent->>Parent: Execute fetch
    Parent-->>Worker: IPC fetch response
    Worker-->>IVM: Resolve fetch promise
    IVM-->>UserCode: Return response
    
    alt Fetch times out (> 5 min)
        Worker-->>IVM: Timeout error
        IVM-->>UserCode: Throw error
    end
    
    UserCode-->>IVM: Return result
    deactivate UserCode
    IVM-->>Worker: Execution complete
    Worker-->>Parent: IPC result
    deactivate Worker
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

No files reviewed, no comments

Edit Code Review Agent Settings | Greptile

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