A second review, of the tree the entry before this left. Six findings, each with a test the reviewer wrote to fail, and six assertions failed against that tree. The first is of the entry before's own making: the record of handles given out made a late word from a follower cost a live session.
This entry revises the one before it in three places, each said where it comes up: the failure that was not explained, the number an attachment was listed with, and the case the record by name was said to leave open.
A follower asks the gateway for a handle and makes the session under one lock, and a beat is read under that lock, so a beat never says "not held" of a handle just granted. An attach read the sessions without it. The reviewer held a follower between the gateway's yes and the session being made, and had it lose its attachment there. It attached again saying it held nothing, the gateway took the handle for ended, and the next beat, which reported the session, was answered with its retirement. Before the record of handles given out the same attach only dropped a route, which the next beat put back.
Two changes, either of which alone keeps that session.
A JVM that was an instance alone and is started again as a gateway keeps its sessions. The run counted them and did not hold their handles as given out, so one that ended later was free to a follower's registration. A run now begins with the handles of the sessions its JVM holds, as its own. Those of sessions that ended before it began are not known to it, as nothing from before a restart is.
An attach changed the run's state twice, the routes and then the node. The watch that tells waits of a change ran between the two, and a node that came back with a session opened while it was away was told as away with one session, while the roster listed it attached. The two are one step now.
A name taken from a holder that did not answer the ping was two steps of the same kind, the holder let go and then the claimant admitted, and a wait was told of a fleet without the node. That is one step as well. Not in the review.
stop! closed the port and then ended the gateway's run. Closing the port lets every follower go, and a
wait for a change could be told of the gateway alone in between, where it is meant to fail as stopped. The
run is ended first, while the port is still open, and the rest of the stop follows the port.
The entry before this left one failure unexplained: a tenth assertion, once, in the test of a wait ending with its gateway. This is its cause, the reviewer found: the follower's stream noticed the closed port before the run was ended.
The entry before this numbered attachments as they arrived, in the gateway's JVM, for a wait to tell one
from the next. A gateway in another process counts from one as well. The reviewer kept a listing from one
gateway, gave it to a wait on the next, and the wait stayed waiting with the node attached anew. A roster now
lists the id the gateway welcomes the attachment with, a random one, and :attachment is a string.
A wait that is told at once did not sweep the waits that were over, so a cancelled one stayed until a wait that had to be left waiting came by. Every wait sweeps now.
The entry before this called it a case left open that another JVM under a name, reporting a handle of its predecessor's, is taken for the predecessor. It is not open. The name is the identity (§15): whatever attaches under a name is that node, and a handle the name was given is routed to whoever reports it under that name, the route still standing or long forgotten. What a run holds to is narrower than the changelog said, and the changelog now says it: a handle the gateway has seen is never given to a node of another name, and one its node has said is ended is given to nobody.
The gateway's and the follower's suites, 109 tests and 406 assertions, against each removal alone. The first eight are this round's. The rest are the entry before's, run again against the source as it is now.
| Removed | Failing assertions |
|---|---|
| An attach's sessions read under the follower's lock | 1 |
| An attach ending no handle (it ends them as a beat does) | 3 |
| The sessions a JVM holds already given out in the run that starts | 1 |
| A node and its routes arriving in one step (the routes, then the node) | 1 |
| A name passing from a silent holder in one step (let go, then admitted) | 1 |
| A gateway's run ended before its port closes | 1 |
| An attachment listed by an id of its own (by a number counted in the JVM) | 1 |
| A wait told at once sweeping the waits that are over | 1 |
| A registration asking who a handle was given to (it asks the routes) | 8 |
| The gateway's own mint asking what was given out (it asks the routes) | 1 |
| A report judged by who a handle was given to (by the routes) | 3 |
| A handle reported without, in a beat, becoming nobody's | 3 |
| A forgotten node's handles staying its own (they are forgotten with it) | 3 |
| The gateway's own handle recorded as given out | 1 |
| A registered handle recorded as given out | 4 |
| The waits chosen in the step that changes the fleet (on a thread, from a later reading) | 1 |
| A wait compared and left waiting under the lock | 1 |
| The run's own clock | 1 |
| Attachments told apart by their own id (by when they attached) | 1 |
| Nothing being told of a run that has ended | 2 |
| The sweep of waits that are over, at a telling and at a wait | 2 |
One test of the entry before's changed with the second fix above: where another JVM takes a name with no sessions, it now says so in a beat before its predecessor's handle is refused to it.
292 tests and 1,159 assertions, without a failure, in each of three runs.
A gateway and a follower on loopback, started for this and stopped after it, neither the dev gateway. A client on the stateless wire.
| A JVM started as an instance alone, a session opened in it, the endpoint stopped and started as a gateway. The session ended, and a mint on the node made to draw its handle first | another handle, at the second draw |
| That handle named in a call through the gateway | refused as not live |
| The node detached with no sessions, the gateway listing itself alone, and a wait given that listing. A session opened on the node at its own endpoint, and the node attaching again | told after 9.5 s, the node listed as attached with one session |
| A wait made in the gateway's JVM, and the gateway stopped with the node attached | failed as stopped, not cancelled |
| A listing kept from that gateway, a gateway started in a fresh process at the same address, the node attaching to it, and a wait there given the listing | told after 2 ms, the node listed with another attachment id |
| A wait there given the fleet just listed | still waiting after 2 s |
The first try at the third row made its wait while the gateway still listed the node attached, five seconds before a write found it gone, and was told of that. The row is the second try, the wait made once the gateway listed itself alone.
A follower held between the gateway's yes and its session, and two attaches taken out of order by a paused gateway, were staged in the suite only: the first is the reviewer's observation between JVMs against the tree before. A name taken from a silent holder under a pending wait was staged in the suite only. The stop was not held between its steps between JVMs, so the row above shows the outcome and not the interleaving. Nothing was run across a network. The dev gateway was not used, and takes a restart to run this.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |