Skip to content

Fix timeout error message race condition for ENG-3372#2144

Merged
mogery merged 1 commit intomainfrom
devin/ENG-3372-1757678224
Sep 15, 2025
Merged

Fix timeout error message race condition for ENG-3372#2144
mogery merged 1 commit intomainfrom
devin/ENG-3372-1757678224

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Sep 12, 2025

Fix timeout error message race condition for ENG-3372

Summary

Fixes a race condition where users were incorrectly seeing "Scrape timed out due to maximum length of 5 minutes" during user-specified timeouts instead of the expected "Scrape timed out" message.

The issue occurred in the Promise.race fallback timeout handler in scrapeURLLoop, which was always using the 5-minute message regardless of whether a user had specified their own timeout. The fix adds a conditional check to determine if we're using the default timeout vs a user-specified timeout and displays the appropriate message.

Changes:

  • Added usingDefaultTimeout check based on meta.abort.scrapeTimeout() === undefined
  • Show "Scrape timed out" for user-specified timeouts
  • Show "Scrape timed out due to maximum length of 5 minutes" only for default timeouts

Review & Testing Checklist for Human

  • Test user-specified timeout scenario: Verify that scrapes with custom timeout values show "Scrape timed out" message when timing out
  • Test default timeout scenario: Verify that scrapes without timeout specified still show "Scrape timed out due to maximum length of 5 minutes"
  • Verify race condition fix: Confirm that the fallback timeout handler no longer overrides the correct AbortManager timeout message
  • Test timeout functionality: Ensure that timeout behavior itself (not just messages) still works correctly for both scenarios

Notes

  • This change only affects error message text, not the underlying timeout logic
  • The fix assumes meta.abort.scrapeTimeout() === undefined reliably indicates default timeout usage
  • No tests were added for this specific timeout message behavior

Link to Devin run: https://app.devin.ai/sessions/0ab061541606484dae4b2df909405ffb
Requested by: @mogery


Summary by cubic

Fixes a race condition that showed the wrong timeout message during scrapes, addressing ENG-3372. User-set timeouts now show “Scrape timed out,” while default timeouts still show the 5-minute message.

  • Bug Fixes
    • Detects default vs user timeout via meta.abort.scrapeTimeout() === undefined.
    • Updates the Promise.race fallback to return the correct timeout message.

- Check if using default timeout vs user-specified timeout
- Show 'Scrape timed out' for user timeouts
- Show 'Scrape timed out due to maximum length of 5 minutes' for default timeout
- Fixes race condition where fallback timeout was always showing 5-minute message

Co-Authored-By: mogery <mo.geryy@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@mogery mogery merged commit 8309eb8 into main Sep 15, 2025
4 of 6 checks passed
@mogery mogery deleted the devin/ENG-3372-1757678224 branch September 15, 2025 10:33
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