Commit Graph

1361 Commits

Author SHA1 Message Date
Tony Garnock-Jones b207a07798 The failing test now passes. The reasons for this are subtle:
The patch here removes a terminated facet from its parent's
`facet-children` set only in a script, and only after all other
scripts enqueued as part of facet termination have executed without an
uncaught exception.

This means that, if (say) a stop script raises an uncaught exception,
it might have happened after some *but not all* scripts resulting from
calls to `retract-facet-assertions-and-subscriptions!` have already
executed. So some endpoints' assertions and subscriptions will have
been removed.

When the uncaught exception is caught by the handler in
`with-current-facet`, a call to `abandon-queued-work!` is made, which
discards queued scripts, including the remaining assertion-cleanup
scripts as well as the scripts for removing dead facets from their
parents' `facet-children` sets. It also (crucially) discards queued
patch actions, including those resulting from already-executed
assertion-cleanup scripts.

At this point, we have a facet tree with some dead facets still in it,
and no queued outbound patches. The assertions for the still-present
dead facets are still logically asserted.

Then, a call to `terminate-actor!` happens, which traverses the whole
tree enqueueing assertion-cleanup scripts. No user code is enqueued,
so (in principle) no exceptions can be signalled.

Once these `terminate-actor!`-enqueued scripts execute, a pending
patch exists that will remove all remaining endpoint assertions.

The remaining sticky point is the calls to `dataspace-unsubscribe!`.
Happily, these are idempotent because of the implementation in
`skeleton.rkt`.

Prior to this patch, terminating facets were removed early from their
parents' `facet-children` sets, meaning there was no way to find them
again to clean up if a failure occurred during a stop script.

Ideally, it'd be easy to see that the code is correct in this respect.
We're not there yet.
2018-04-25 20:43:25 +01:00
Tony Garnock-Jones 18418dfc13 Failing test: an exception in a stop script messes up cleanup 2018-04-25 20:13:54 +01:00
Tony Garnock-Jones 5dd7ec4ae0 Test case showing correct behaviour for old implementation 2018-04-25 20:08:07 +01:00
Tony Garnock-Jones e7f3dab519 Run stop-scripts in one scheduled execution 2018-04-25 19:54:58 +01:00
Tony Garnock-Jones 762d1d4250 Be specific in for-loops 2018-04-25 19:47:18 +01:00
Tony Garnock-Jones 76c0fe03c9 Guard against double-adhoc-assertion 2018-04-25 19:46:08 +01:00
Tony Garnock-Jones d298ad2c66 Remove redundant `facet-live?` test 2018-04-25 19:40:53 +01:00
Tony Garnock-Jones 2878386805 Omit "name" to ctor for dataspace struct - name is/will be a property of the downward relay connection 2018-04-25 19:30:45 +01:00
Tony Garnock-Jones 1b1c598aa0 during/spawn 2018-04-22 21:07:35 +01:00
Tony Garnock-Jones 8cb4e947a5 Correct typo 2018-04-22 21:06:18 +01:00
Tony Garnock-Jones d93d773c23 Repair: it is incorrect to invoke retraction-handlers when retracting an interest 2018-04-22 21:04:22 +01:00
Tony Garnock-Jones e4a9f1fa8f Repair error: stop-facet scripts must run in parent facet's context! 2018-04-22 21:03:21 +01:00
Tony Garnock-Jones 6a7b9d57db Notice attempts to install more than one root facet in an actor 2018-04-22 21:03:01 +01:00
Tony Garnock-Jones 6de484b307 Introduce action-groups 2018-04-22 21:02:40 +01:00
Tony Garnock-Jones 3707782906 Improve debug-printing of facets 2018-04-22 21:00:35 +01:00
Tony Garnock-Jones d00a0c3216 Remove unused dataspace-actors field 2018-04-22 20:59:57 +01:00
Tony Garnock-Jones 7283eb8362 Implement during and ad-hoc assertions 2018-04-19 17:55:52 +01:00
Tony Garnock-Jones dd816a74ca Better Isolated Turn Principle 2018-04-11 12:28:09 +01:00
Tony Garnock-Jones d37a675afc Improve syntax location tracking 2018-04-09 10:29:14 +01:00
Tony Garnock-Jones b8e00e90f9 Script suspend and resume 2018-04-09 10:23:22 +01:00
Tony Garnock-Jones 8fcf765192 Simple messages-per-second test (~195kHz at present) 2018-04-08 12:06:37 +01:00
Tony Garnock-Jones 0673d6d9b3 Progress on syntax veneer 2018-04-08 11:44:32 +01:00
Tony Garnock-Jones 0e2384514f Eliminate (interesting uses of) facet IDs by storing references directly 2018-04-08 08:52:37 +01:00
Tony Garnock-Jones a4591944f1 More structured FID representation. 2018-04-08 07:58:17 +01:00
Tony Garnock-Jones e1de8a2814 Steps toward API usable by syntax layer; beginning of syntax layer, adapted from previous implementation 2018-04-08 07:39:39 +01:00
Tony Garnock-Jones 811a7a0a45 Fine-tune skeleton-accumulator representations for persistency/reuse and for potential speed benefit 2018-04-08 07:01:39 +01:00
Tony Garnock-Jones 210afa2395 Correct typo 2018-04-07 08:42:38 +01:00
Tony Garnock-Jones bdd8a0e4ff printf to log-info; clean up demo output 2018-04-06 12:07:09 +01:00
Tony Garnock-Jones ffa5b616ab Eliminate a few useless parameters 2018-04-06 11:58:49 +01:00
Tony Garnock-Jones 6a0439cbd0 POC imperative dataspace implementation, with set-box example 2018-04-06 11:37:59 +01:00
Tony Garnock-Jones 55dbc2f29a Switch to skeleton-stx with struct-type rather than predicate 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 7767563ff6 Rearrange 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 4a470bd2e0 Start translation of pattern syntax to various structures 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 5f78b24dc3 Initial sketch of new routing-table idea 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 06224b52a8 Repair syndicate/js just like commit 1fa5167 repaired syndicate/rkt. 2018-03-27 22:21:14 +13:00
Tony Garnock-Jones 1fa5167e20 Fix a design flaw in Syndicate-HLL for syndicate/rkt.
If:
 - a field is used in an assertion of interest in facet A
 - and that field changes
 - to a value that causes the assertion of interest to overlap
   with some facet B's assertion of interest
 - and an assertion matching that interest was already known to the actor,
Then:
 - previously, facet A would not be informed of the matching assertion
 - but now, it is informed of the matching assertion.

This more or less only affects "on asserted" endpoints.

The change here should be written up as an erratum to chapter 5 in my
dissertation. Also, syndicate/js needs to be checked for the bug and
probably fixed in an analogous way.
2018-03-27 21:58:57 +13:00
Tony Garnock-Jones 55e1f09484 New "bug" (?) 2018-03-22 13:49:16 +13:00
Tony Garnock-Jones af150712e0 example-memoized.rkt 2018-03-06 17:35:40 +00:00
Tony Garnock-Jones 57a40e9576 Asynchronously send UDP packets.
Switch from synchronous to asynchronous UDP transmission, in case DNS
resolution takes a long time or fails. Specifically, in case of failure,
previously the UDP actor would crash, whereas now the packet is just
"dropped".
2018-03-06 11:12:57 +00:00
Tony Garnock-Jones 62f8385b24 Remove unused definition 2018-02-09 11:15:53 +00:00
Tony Garnock-Jones 22d837d6a4 Clarify use of LGPLv3 license. Closes #35. 2018-01-17 13:24:39 +00:00
Tony Garnock-Jones 1ab4f0f525 Alternate approach to caching 2017-12-06 09:13:28 +00:00
Tony Garnock-Jones f11f4fd054 tcp-relay2.rkt 2017-12-05 17:38:49 +00:00
Tony Garnock-Jones eb44003317 New examples 2017-12-05 17:32:12 +00:00
Tony Garnock-Jones eb564fdb7c More general tcp-connect error catching. 2017-12-05 17:22:28 +00:00
Tony Garnock-Jones c9ec9f6be9 Special printer for seals. Fixes #27. 2017-12-05 17:22:13 +00:00
Tony Garnock-Jones 75093d0e1a Fullscreen big-bang 2017-11-25 12:03:32 -05:00
Tony Garnock-Jones 1dbab91ccc Content-Type header 2017-11-15 07:12:26 -05:00
Tony Garnock-Jones 53e26b08a1 Many improvements to the netstack TCP implementation.
- New timestate `on-timeout` complementing `stop-when-timeout`
 - IP layer avoids spurious reordering
 - Demo HTTP server sends 4kB responses, for testing

 - TCP now has something closer to proper sliding-window behavior
 - TCP RTT estimator
 - TCP now uses timestate driver rather than raw timer driver
 - Many small TCP bugs found and fixed
2017-11-13 20:02:07 +00:00
Sam Tobin-Hochstadt 87495bdc37 Fix missing dependency. 2017-11-12 14:04:36 +00:00