A review of the gateway with the wait for a change on it, the entry before this. Five findings, and for each a test the reviewer wrote to fail. Against the source as it was they failed nine assertions in each of three runs. A run before those failed a tenth, in a test from the entry before this, of a wait ending with its gateway. It had passed in every run until the reviewer's tests stood beside it, and why it failed that once was not found; the telling it ran against is replaced below.
A route ended with its session. When a node reported without a handle, nothing the gateway consulted for the next claim held it any more, and the next instance to draw it was granted it. A client that still had the handle saved then named a session on another machine, with every JVM up throughout.
A run now keeps every handle it has seen given out, with the name it was given out under: its own, those registered, and those first heard of in a report. A handle its node reports without is nobody's from then on. A registration for it is refused, the gateway's own minter redraws, and a report of it from another node is answered with a retirement.
Two things were weighed on the way.
The watch on a run's state started a thread, and the thread read the state again and took whichever waits there were by then. The reviewer held one such thread after its reading, attached a second node, made two waits, and both were given the fleet from before the second node. Held the other way, a wait made before a node attached and left again was still waiting when both tellings had finished.
Which waits a change tells is now decided in the step that makes it. The state is only ever changed holding the run's lock, and the watch runs there: it takes the waits that saw another fleet than the one just made and hands them, with that fleet's roster, to a thread that settles them. A wait compares and is left waiting under the same lock.
The manual said that nothing between a look and a wait is missed. A roster shows a change that still stands. A node that came and went in between, with no session opened on it, leaves the fleet as it was seen, and the manual now says so.
Nodes past their time were looked for when a node attached, and at no other time. With the expiry shortened, the reviewer saw a departed node stay listed on an idle gateway, and a wait for the fleet to change stay waiting, until an attach that was itself refused removed the row.
A run now looks once a beat, on a thread of its own that ends with the run. The look at an attach is gone.
A wait told a name that had been attached again from the attachment before it by when each attached, to the millisecond. With the clock held, two attachments under one name had the same time, and a wait given the first roster waited for a change that had happened.
Attachments are numbered as they arrive, across the JVM's runs, and a roster row carries the number as
:attachment. The wait compares that. :since stays, for reading.
A test from the entry before this compared two whole rosters, with the seconds since each node was heard from. The reviewer delayed the second reading by a little over a second and it failed on that field. It compares who is listed and whether each is attached.
The gateway's suite, 54 tests and 223 assertions, against each removal alone.
| Removed | Failing assertions |
|---|---|
| A registration asking who a handle was given to (it asks the routes) | 7 |
| 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) | 2 |
| A handle reported without becoming nobody's | 2 |
| 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 number (by when they attached) | 1 |
| Nothing being told of a run that has ended | 1 |
| The sweep of waits that are over | 1 |
Two failed nothing at first.
The suite was then run three times unchanged, without a failure.
284 tests and 1,125 assertions, without a failure.
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 gateway.
| A session opened on the node, the node's JVM stopped, another started under its name. A mint there made to draw the first session's handle first | another handle, at the second draw |
| The same draw forced in the gateway's own JVM | another handle, at the second draw |
| The first session's handle named in a call through the gateway, before and after those | refused as not live |
| A listing kept, the node's JVM replaced under its name, a wait given the listing | told at once, the node listed with attachment 3 where the listing had 2 |
| A wait given the fleet just listed | still waiting after 3 s |
| Expiry set to 30 s in the trial gateway. A node with one session stopped, a wait given the fleet that lists it away, last heard 17 s before, and nothing attaching | told after 12.3 s, the gateway alone listed |
The forced draws were not made between JVMs against the source as it was: that the handle was granted there is the reviewer's observation and the removals above. Expiry at its real length, a day, was not waited out. A node that came and went under a pending wait, and two attachments within a millisecond, were staged in the suite only. A node forgotten and then back with its sessions was not staged between JVMs. Nothing was run across a network. The dev gateway was not used: a run has a table more than it had, so it takes a restart.
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 |