Page MenuHomePhabricator

[chronik-client] Do not try next server if error is unrelated to server outage
ClosedPublic

Authored by bytesofman on Jan 19 2024, 16:32.

Details

Summary

chronik-client is treating legitimate errors as server connection errors (for example, trying to get a block that does not exist, or a tx that fails to broadcast in NNG)

Server connection errors have a code key while chronik method errors do not. Use this instead of a string check which conflicts with other types of chronik errors.

This supersedes D15150

Test Plan

See test plan in D14915 or let CI build it. Ref draft D15210 which tests this against a method where chronik is expected to fail for non-server reasons.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested changes to this revision.Jan 19 2024, 21:09
Fabien added a subscriber: Fabien.
Fabien added inline comments.
modules/chronik-client/README.md
88 ↗(On Diff #44363)

? This is not from this diff

This revision now requires changes to proceed.Jan 19 2024, 21:09
modules/chronik-client/README.md
88 ↗(On Diff #44363)
emack requested changes to this revision.Jan 20 2024, 10:48
emack added a subscriber: emack.
emack added inline comments.
modules/chronik-client/README.md
88 ↗(On Diff #44363)

Remove and then rebase to D15214

modules/chronik-client/src/failoverProxy.ts
132 ↗(On Diff #44363)

'endpoint failures' sounds like server outage which initially got me confused why you were not checking for the absence of 'code'. 'Method errors' would be a better term here.

This revision now requires changes to proceed.Jan 20 2024, 10:48
bytesofman marked 2 inline comments as done.

rebase on readme patch, improve code comments

This revision is now accepted and ready to land.Jan 22 2024, 10:02