mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 07:35:19 +03:00
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:
parent
6d1636b566
commit
526e60b04c
@ -332,6 +332,7 @@
|
|||||||
::
|
::
|
||||||
:: TODO: We should gracefully retry on restart instead of just sending a
|
:: TODO: We should gracefully retry on restart instead of just sending a
|
||||||
:: cancel.
|
:: cancel.
|
||||||
|
:: TODO we might not want to do that though!
|
||||||
::
|
::
|
||||||
=/ moves=(list move)
|
=/ moves=(list move)
|
||||||
%+ turn ~(tap by connection-by-duct.state.ax)
|
%+ turn ~(tap by connection-by-duct.state.ax)
|
||||||
|
@ -386,6 +386,14 @@
|
|||||||
|= tin=strand-input:strand
|
|= tin=strand-input:strand
|
||||||
?+ in.tin `[%skip ~]
|
?+ in.tin `[%skip ~]
|
||||||
~ `[%wait ~]
|
~ `[%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 *]
|
[~ %sign [%request ~] %iris %http-response %finished *]
|
||||||
`[%done client-response.sign-arvo.u.in.tin]
|
`[%done client-response.sign-arvo.u.in.tin]
|
||||||
==
|
==
|
||||||
|
@ -292,7 +292,7 @@
|
|||||||
?+ p.cage.sign `state
|
?+ p.cage.sign `state
|
||||||
%thread-fail
|
%thread-fail
|
||||||
=+ !<([=term =tang] q.cage.sign)
|
=+ !<([=term =tang] q.cage.sign)
|
||||||
?. =(term %cancelled)
|
?. |(=(term %cancelled) =(term %http-request-cancelled))
|
||||||
=. charges (new-chad:cha hung+'glob-failed')
|
=. charges (new-chad:cha hung+'glob-failed')
|
||||||
:- ~[add-fact:cha]
|
:- ~[add-fact:cha]
|
||||||
((slog leaf+"docket: thread failed;" leaf+<term> tang) state)
|
((slog leaf+"docket: thread failed;" leaf+<term> tang) state)
|
||||||
|
Loading…
Reference in New Issue
Block a user