Skip to content
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

fix(server): Gracefully handle getFile ECONNREFUSED when worker network is reconfiguring #3079

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/openneuro-server/src/handlers/datalad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
}
} catch (err) {
// ConnectTimeoutError is Node/Undici and TimeoutError is the standard DOMException name
// "fetch failed" can mean the connection failed at setup (network is unavailable)

Check warning on line 42 in packages/openneuro-server/src/handlers/datalad.ts

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-server/src/handlers/datalad.ts#L42

Added line #L42 was not covered by tests
if (
err?.cause?.name === "ConnectTimeoutError" ||
err?.name === "TimeoutError"
err?.name === "TimeoutError" ||
err?.name === "TypeError" && err?.message.includes("fetch failed")

Check warning on line 46 in packages/openneuro-server/src/handlers/datalad.ts

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-server/src/handlers/datalad.ts#L45-L46

Added lines #L45 - L46 were not covered by tests
) {
// Unreachable backend, forward this error
// Usually this is the service restarting due to node migrations or upgrades
Expand Down
Loading