strandio: fail when http request gets cancelled

Instead of waiting for a proper response. Iris doesn't currently retry!

Also updates docket to detect this case and retry appropriately.
This commit is contained in:
Fang 2021-09-28 20:50:55 +04:00
parent 6d1636b566
commit 526e60b04c
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
3 changed files with 10 additions and 1 deletions

View File

@ -332,6 +332,7 @@
::
:: TODO: We should gracefully retry on restart instead of just sending a
:: cancel.
:: TODO we might not want to do that though!
::
=/ moves=(list move)
%+ turn ~(tap by connection-by-duct.state.ax)

View File

@ -386,6 +386,14 @@
|= tin=strand-input:strand
?+ in.tin `[%skip ~]
~ `[%wait ~]
::
[~ %sign [%request ~] %iris %http-response %cancel *]
::NOTE iris does not (yet?) retry after cancel, so it means failure
:- ~
:+ %fail
%http-request-cancelled
['http request was cancelled by the runtime']~
::
[~ %sign [%request ~] %iris %http-response %finished *]
`[%done client-response.sign-arvo.u.in.tin]
==

View File

@ -292,7 +292,7 @@
?+ p.cage.sign `state
%thread-fail
=+ !<([=term =tang] q.cage.sign)
?. =(term %cancelled)
?. |(=(term %cancelled) =(term %http-request-cancelled))
=. charges (new-chad:cha hung+'glob-failed')
:- ~[add-fact:cha]
((slog leaf+"docket: thread failed;" leaf+<term> tang) state)