Skip to content

fix: time out stalled source and destination requests - #232

Open
ChiragAgg5k wants to merge 2 commits into
2.0.xfrom
fix/request-timeouts
Open

ChiragAgg5k wants to merge 2 commits into
2.0.xfrom
fix/request-timeouts

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

A source or destination that accepts the connection and never answers held the migration worker in curl_exec forever. The migration stayed processing with nothing logged, and the E2E poll timed out at 60s.

#0 curl_exec                       vendor/appwrite/appwrite/src/Appwrite/Client.php:504
#1 Appwrite\Client->call           .../Services/Users.php:56
#2 Appwrite\Services\Users->list   src/Migration/Sources/Appwrite.php:409
#3 Sources\Appwrite->reportAuth    src/Migration/Sources/Appwrite.php:355
#4 Sources\Appwrite->report        (Appwrite migrations worker)

Neither transport had a timeout: Target::call sets none, and the Appwrite SDK Client defaults to none.

Transport Connect Request
Target::call (raw curl: version probe, file downloads) 10s abandoned after 30s with no bytes received (LOW_SPEED_*), so long downloads that keep moving are unaffected
Appwrite SDK clients in Sources\Appwrite / Destinations\Appwrite 10s 30s total (the SDK only exposes a total timeout; its requests are single pages and chunks)

The constants are public on Target, so consumers that build their own SDK client for the same source can use the same limits.

Tests

The behaviour is covered end to end in appwrite/appwrite#14330 (testAppwriteMigrationFailsWhenSourceNeverAnswers). Without this change, a migration against a source that never answers stays processing, with the worker blocked in curl_exec. With it, the migration fails after 30s with Operation timed out after 30000 milliseconds with 0 bytes received.

Unit suite: 89 tests OK. composer lint and composer check are clean.

Overlaps Target::call() with #230. Whichever merges second needs a trivial rebase.

A remote that accepts the connection and never answers left curl waiting
forever, so the migration worker sat on the job and the migration stayed
in processing with nothing logged. Connections now give up after 10s,
Target::call abandons a response that sends nothing for 30s, and the
Appwrite SDK clients cap each request at 30s, so the stall surfaces as a
failed migration.
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptileai review

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