A third review, of the tree the entry before this left. Four findings, none with a test this time: the reviewer staged each between JVMs and described it. The tests here are written from those descriptions.
This entry revises the one before it in one place, said where it comes up: what an attach does to the routes it does not report.
The entry before this stopped an attach from ending a handle, and left it dropping the routes it did not report, on the reasoning that the next report puts them back. The reviewer held an attach that reported nothing at the gateway until the follower gave it up. A later attachment registered a session, confirmed it in a beat, and went away. While the old attach was still held, a call naming the session was told to wait for the node. Once it was let go, the gateway took it, found nobody at the other end, and the route was gone with no report to follow: the call was told to open a new session, of one that was live and was routed again when the node came back.
An attach now only adds. What it reports is routed and recorded, what it leaves out keeps its route and stays the name's, and a beat is what drops a route and ends a handle. A follower reports as soon as it is welcomed, so on a node that is there the two are a moment apart. In that moment a call naming a session the node's JVM does not hold is carried to the node, which refuses it as any instance refuses a session it has not got.
One test of an earlier entry's changed with it: where another JVM takes a name, the report it makes on being welcomed is now what takes its predecessor's session off the roster.
The entry before this ended a gateway's run before closing its port. Between the two the run has every node attached and answers at its port, and three things were still done on it.
A start that fails once its port is open closed the port and then gave the role up. With a node attached and a wait pending by then, the wait was told of the gateway alone. The undoing ends the run first, by the step the stop uses.
It said the gateway keeps no state of its own. It persists nothing; it does keep in memory, for as long as it runs, which ids it has given out and which it has retired, and the README says so.
The gateway's and the follower's suites, 115 tests and 435 assertions, against each removal alone. The first seven are this round's. The rest are the two entries before's, run again against the source as it is now.
| Removed | Failing assertions |
|---|---|
| An attach dropping no route (it drops those it leaves out) | 5 |
| A beat settling nothing of a run that has ended | 3 |
| A registration granted nothing by a run that has ended | 3 |
| A wait for a node failing on a run that has ended (it is given the node) | 3 |
| A welcome telling no wait of a run that has ended | 2 |
| A start undone ending its run before the port closes (the port first) | 1 |
| A wait for a node looked for and left waiting under the lock | 1 |
| 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, at a stop | 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 | 5 |
| 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 | 3 |
| The sweep of waits that are over, at a telling and at a wait | 2 |
The seventh had no test at first. A wait for a node was not under the lock before this round: it looked, left itself waiting, and looked again. The test written for it holds a wait after its look, lets a node attach and be welcomed, and asks that the wait is settled.
298 tests and 1,188 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, with a session on the node opened through the gateway and one on the gateway.
| The node's session used, a beat let pass, and the node's JVM suspended. A call naming the session once the gateway had found the node quiet | told the node is not attached, last heard 25 s ago, and to try again when it is back |
| An attach sent by hand under the node's name, reporting no sessions, and hung up after three seconds. The roster while it was held | the node attached, with one session |
| The roster once the gateway had found that attach gone, eight seconds on | the node away, with one session |
| The same call then | told the node is not attached, last heard 10 s ago, and to try again when it is back |
| The node's JVM resumed | attached after 2 s, with one session, and the call answered |
| The gateway's run ended in its JVM with the port open, and a session opened at the node's own endpoint | opened, and the gateway's routes and record as they were nine seconds later |
| A session on the node asked of the gateway then | refused: the gateway has stopped, and nothing was run |
| A wait for the node and one for a change, made on the ended run with the node attached | both failed as stopped, neither cancelled |
| The follower, at its next beat | let the gateway go, and its attach was refused with 503 |
The late attach moved "last heard" from 25 s to 10 s: a node's silence is counted from its last attachment, and that was one. The attach was not held at the gateway behind a later one, as the reviewer held it; it was sent late, which the gateway cannot tell from that.
The follower printed that the gateway does not answer before it printed the refusal. It had closed the stream itself, on the beat that was refused, and the read that ended with that is reported as an attach that could not be made. The line is as old as the watch, and is wrong only in what it says.
The stop was not held between ending the run and closing the port between JVMs: the run was ended by hand in the gateway's JVM, which leaves the same state. A welcome held across the end of its run, and a start undone once it answers, were staged in the suite only. A registration granted by an ended run, against the source as it was, is the reviewer's observation and the removals above. 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 |