eyre: clog exclusively for %facts

Eyre's clog logic was a tad inconsistent about "only facts" vs "not poke-acks".
This makes it consistently say "only facts" when it comes to clog-related logic.
Yes, in theory this means %watch-acks and %kicks can build up endlessly, but
those should take up negligible space compared to %facts.

Should fix any oddball cases of crashes here that #3835 didn't already catch.
This commit is contained in:
fang 2020-11-10 22:06:28 +01:00 committed by GitHub
parent f5e08bae03
commit 3ca993df07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1504,11 +1504,13 @@
?~ channel
:_ state :_ ~
[duct %pass /flog %d %flog %crud %eyre-no-channel >id=channel-id< ~]
:: it's possible that this is a fact emitted directly alongside a fact
:: it's possible that this is a sign emitted directly alongside a fact
:: that triggered a clog & closed the subscription. in that case, just
:: drop the fact.
:: drop the sign.
:: poke-acks are not paired with subscriptions, so we can process them
:: regardless.
::
?: ?& ?=(%fact -.sign)
?: ?& !?=(%poke-ack -.sign)
!(~(has by subscriptions.u.channel) request-id)
==
[~ state]
@ -1547,10 +1549,10 @@
:: update channel's unacked counts, find out if clogged
::
=^ clogged unacked.u.channel
:: poke-acks are one-offs, don't apply clog logic to them.
:: only apply clog logic to facts.
:: and of course don't count events we can't send as unacked.
::
?: ?| ?=(%poke-ack -.sign)
?: ?| !?=(%fact -.sign)
?=(~ json)
==
[| unacked.u.channel]
@ -1567,6 +1569,10 @@
=* kicking |(clogged ?=(~ json))
=? moves kicking
:_ moves
::NOTE this shouldn't crash because we
:: - never fail to serialize subscriptionless signs (%poke-ack),
:: - only clog on %facts, which have a subscription associated,
:: - and already checked whether we still have that subscription.
=+ (~(got by subscriptions.u.channel) request-id)
:^ duct %pass
(subscription-wire channel-id request-id ship app)