Commit Graph

929 Commits

Author SHA1 Message Date
Brian Warner
693e215d8b sketching out a journal-based demo app 2017-04-06 12:21:00 -07:00
Brian Warner
7f3e86acca more fussing, split out M_S0 2017-04-06 12:21:00 -07:00
Brian Warner
f6930a9bfc more thoughts 2017-04-06 12:21:00 -07:00
Brian Warner
cf981222c5 think about "checkpointing" as a state
with async exit when the checkpoint is finally written. Not sure this is the
best idea.
2017-04-06 12:21:00 -07:00
Brian Warner
20b80be342 remove stale machines 2017-04-06 12:21:00 -07:00
Brian Warner
3af375b173 finish Mailbox state machine, including close 2017-04-06 12:21:00 -07:00
Brian Warner
b934192f20 work on Mailbox machine 2017-04-06 12:21:00 -07:00
Brian Warner
11a80f0018 moving to separate machine class 2017-04-06 12:21:00 -07:00
Brian Warner
3bf762b4f7 try coding top-level WormholeMachine 2017-04-06 12:21:00 -07:00
Brian Warner
faab1e87d0 split _machine.py out 2017-04-06 12:21:00 -07:00
Brian Warner
17a90d87ac tweaks 2017-04-06 12:21:00 -07:00
Brian Warner
35324a7911 my StateMachine can now render .dot 2017-04-06 12:21:00 -07:00
Brian Warner
0fe6cfd994 tweaks 2017-04-06 12:21:00 -07:00
Brian Warner
0b05c9ca5a new experimental state-machine language
I think I want to express actions as transient states. _c2.py matches w4.dot
2017-04-06 12:21:00 -07:00
Brian Warner
a9a0bc43c7 w4.dot: redraw Connection Machine to match 2017-04-06 12:21:00 -07:00
Brian Warner
0b28137948 w3.dot: figure out close() pathways
d=M_close() will always do the verbose clean shutdown thing, and the Deferred
won't fire (e.g. we won't move to state "Ss") until we've deallocated our
server resources (nameplates and mailboxes), and we've finished shutting down
our websocket connection. So integration tests should wait on the Deferred to
make sure everything has stopped moving and the reactor is clean.

CLI applications that are following the success path can use M_close() and
wait on the Deferred before terminating.

CLI applications that wind up on some error path can either use M_close(), or
just SIGINT and leave the server to GC stuff later.

GUI applications can use M_close() but ignore the Deferred, and assume that
the program will keep running long enough to get the deallocation messages
through.

GUI+DB applications can use M_close() and then stop recording state changes,
and if the program remains running long enough, everything will be
deallocated, but if it terminates too soon, the server will have to GC.
2017-04-06 12:21:00 -07:00
Brian Warner
86f246dbdb just might work. close() mapped out.
Starting to draw a distinction between clean-close and abrupt-halt. At least,
if we're in the connected state, wormhole.close() should take its time and
free up server-side resources (nameplate/mailbox) right away, rather than
relying on GC/timeouts to release them.

It might be useful to make separate "clean" wormhole.close() and "abrupt"
wormhole.halt() API calls, except that really when would you ever call halt?
To be realistic, only one of two things will happen:

* connection happens normally, app finishes, calls "clean" close()
* app terminates suddenly, via exception or SIGINT

The problem with defining .close() is that I have to make it work sensibly
from any state, not just the one plausible "connected" state. Providing
.halt() requires defining its behavior from everywhere else.
2017-04-06 12:21:00 -07:00
Brian Warner
2cfc990d5e more 2017-04-06 12:21:00 -07:00
Brian Warner
5b82b424a0 w.dot: comment out things that seem superceded by w2.dot 2017-04-06 12:21:00 -07:00
Brian Warner
fa76b57976 w2.dot: add M_ prefix 2017-04-06 12:21:00 -07:00
Brian Warner
e7b2a7bbf9 fixing 118 is the key 2017-04-06 12:21:00 -07:00
Brian Warner
f85e2ec68a more 2017-04-06 12:21:00 -07:00
Brian Warner
f27e601e41 more 2017-04-06 12:21:00 -07:00
Brian Warner
78fcb6b809 new approach, thinking about connections up front 2017-04-06 12:21:00 -07:00
Brian Warner
6c77f33cdf start on connection machine 2017-04-06 12:21:00 -07:00
Brian Warner
3ec7747b1e more 2017-04-06 12:21:00 -07:00
Brian Warner
b1f313b116 more diagram work 2017-04-06 12:21:00 -07:00
Brian Warner
8a9b50b320 adding high-level state diagram
Automat doesn't let me combine flowcharts with state machines in a way that's
useful for documenting my thoughts.
2017-04-06 12:21:00 -07:00
Brian Warner
057f616765 more experimentation 2017-04-06 12:21:00 -07:00
Brian Warner
18f7ab9308 more state-machine work 2017-04-06 12:21:00 -07:00
Brian Warner
63ae3c63fc notes 2017-04-06 12:21:00 -07:00
Brian Warner
9e5bf452e3 rename 2017-04-06 12:21:00 -07:00
Brian Warner
3c9c0e58ab move to _connection.py, add more state machines
Starting on defining manager state machines for nameplates, mailboxes, the
PAKE key-establishment process, and the bit that knows it can drop the
connection when both nameplates and mailboxes have been released.
2017-04-06 12:21:00 -07:00
Brian Warner
14c8e76364 onConnect, start manual tests, doesn't work yet 2017-04-06 12:21:00 -07:00
Brian Warner
b826e8c73c hack args till they work, add ALLOW_CLOSE
the diagram is a lot simpler if the only way to shut things down is to
terminate the whole process
2017-04-06 12:21:00 -07:00
Brian Warner
d136028fa8 try adding args 2017-04-06 12:21:00 -07:00
Brian Warner
73f3d86107 state machine should be complete, I think 2017-04-06 12:21:00 -07:00
Brian Warner
94b1ed8739 starting to draw new state machines 2017-04-06 12:21:00 -07:00
Brian Warner
578522ae0f Merge PR141 2017-04-06 12:12:58 -07:00
Brian Warner
98e3df1e4d api.md: mark argument slightly better 2017-04-06 12:12:42 -07:00
Shirley Kotian
abec2d2680 typos 2017-03-18 18:39:54 +05:30
Brian Warner
65db4729cd rendezvous_websocket.py: add idempotency docs 2017-03-03 05:55:39 -08:00
Brian Warner
8d5770d8cc tor_manager: allow port to be a 'long' 2017-03-03 05:49:36 -08:00
Brian Warner
b7ff5f05d5 transit: allow port to be a 'long' 2017-03-03 05:49:30 -08:00
Brian Warner
cf9053637c test_util: free-space can be a 'long' 2017-03-03 05:49:25 -08:00
Brian Warner
71f34e4f5b test/run_trial.py: protect run() with __name__
Without this, any import (e.g. when running "automat-visualize") caused the
tests to be run as a side-effect.
2017-02-22 18:03:33 -08:00
Brian Warner
6889ba088c remove server/runner.py, no longer used 2017-02-22 17:52:14 -08:00
Brian Warner
4df4cf0016 Merge PR139
closes #73
2017-02-22 17:48:20 -08:00
Shannon Mulloy
ffefb5ebdc improve coverage with input mock 2017-02-05 15:42:49 -08:00
Shannon Mulloy
33526b2180 rx: _remove_existing after accept 2017-02-05 13:29:20 -08:00