Skip to content

improvement(function): timeout increase to 5 min - #3040

Merged
icecrasher321 merged 1 commit into
stagingfrom
fix/timeout-function
Jan 28, 2026
Merged

improvement(function): timeout increase to 5 min#3040
icecrasher321 merged 1 commit into
stagingfrom
fix/timeout-function

Conversation

@icecrasher321

Copy link
Copy Markdown
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

vercelBot commented Jan 28, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentReviewUpdated (UTC)
docsSkippedSkippedJan 28, 2026 3:29am

Request Review

@icecrasher321
icecrasher321 merged commit 8bdba37 into stagingJan 28, 2026
7 checks passed
@greptile-apps

Copy link
Copy Markdown
Contributor

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

FilenameOverview
apps/sim/lib/execution/isolated-vm-worker.cjsIncreased 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

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

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

@waleedlatif1
waleedlatif1 deleted the fix/timeout-function branch January 28, 2026 07:40
royceP2 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Mar 3, 2026
Sign up for freeto 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

@icecrasher321