Commit Graph

130 Commits

Author SHA1 Message Date
Michael Bayne f92350f1b3 Bah, don't include the PresentsDObjectMgr's state when trying to assert our
invariants.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5944 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 19:36:33 +00:00
Michael Bayne 1c60b9cc75 Promote the datagramHostname to the bindHostname and use it for our TCP
connections as well.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5942 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-09-10 18:34:42 +00:00
Michael Bayne 31eda1cfc9 Let's do that *after* we've checked sochan for nullity.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5871 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-13 02:12:57 +00:00
Michael Bayne 0cf6b6199e Don't try writing overflow messages for an outgoing connection that is still
waiting to connect.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5870 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-13 02:12:24 +00:00
Michael Bayne c6ba34a129 You'd think that calling isConnectionPending() would return true on a channel
that would throw a NotYetConnectedException when you tried to write to it. Yes,
you'd definitely think that.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5865 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-13 00:22:24 +00:00
Michael Bayne 6d740bf7b3 Truth in commenting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5856 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-10 06:31:49 +00:00
Michael Bayne 95bae1dec8 We need to distinguish between a connection that is still pending (which may be
the case for an outgoing connection since we do our connection asynchronously)
and a connection that is no longer connected because it once was open and now
it's closed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5855 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-07-10 06:30:41 +00:00
Michael Bayne 6e9077780c Added/updated source headers.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5829 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-20 21:09:34 +00:00
Michael Bayne a1aa2d77ae Revamping/cleanup of how we handle authentication usernames as well as chained
authenticators and chained session factories. We can share a lot more code this
way and the implicit requirement that the default authenticator/factory had to
be configured before anyone else configured a chanied author/factory is gone.

The other big change is that Credentials doesn't require a username
(UsernamePasswordCreds inherits that username so most derived classes don't
notice any difference). Instead we require that a canonical authentication
username be determined and configured in AuthingConnection during the
authentication process. This canonical username is then used to resolve the
client session and map everything in the client manager.

This is pretty much exactly what was going on before except that we were doing
it all in an ad hoc way by jamming a new name into Credentials during the
authentication process and also doing jiggery pokery in
PresentsSession.assignStartingUsername. That all goes away and/or becomes
cleaner and more explicit.

This is going to impact some Yohoho jiggery pokery, which I will shortly commit
a patch for, but we're going to need to test it. Omelets, eggs, etc.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5828 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-20 00:56:01 +00:00
Michael Bayne 1e6c35f9c1 If we have no socket or a closed socket when trying to write overflow queue
messages, treat that like a network failure which will clear out that queue and
shutdown the connection. Overflow queues are only meant to handle sockets that
are backed up, not closed or non-existent.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5813 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-06-02 22:59:23 +00:00
Michael Bayne 3f19fcacf2 Moved Lifecycle to samskivert (my initial desire to do this came from a
non-work project). I promise to stop fooling around now.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5805 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 19:16:49 +00:00
Michael Bayne e87c86dc2c Let's make the Lifecycle a bit more abstract and decouple it from all the
server business. I'd move the whole kit and kaboodle to samskivert but that
would mean moving the DependencyGraph as well...


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5804 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 19:09:47 +00:00
Michael Bayne 0a20b36c8e Out with ShutdownManager, in with LifecycleManager which handles both
initialization and shutdown. This will obviate the need for a lot of manual
wiring up. ShutdownManager still works and passes through to LifecycleManager,
but switching to the new deal is encouraged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5802 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-27 18:32:45 +00:00
Andrzej Kapolka e5172053c8 The utility of printing out the message as a byte array seems
limited.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5796 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-21 23:47:47 +00:00
Andrzej Kapolka 31e9807c05 Note the actual transport with which events are transmitted.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5794 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-21 18:41:42 +00:00
Andrzej Kapolka d45b0bdb00 Added an option to bind the datagram socket to a specific
hostname, in hopes of fixing the issue with receiving datagrams 
from the staging server.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5793 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-21 18:04:09 +00:00
Andrzej Kapolka 6dd16483be Added an extra step to the datagram negotation process. Before
the server starts sending datagrams willy-nilly, it must wait for 
a (reliable) go-ahead from the client.  Otherwise, it's possible 
that the server may be successfully receiving datagrams but not 
sending them.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5792 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-05-21 04:16:41 +00:00
Michael Bayne 688f2580ed Varargified log calls.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5697 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-03-26 00:02:19 +00:00
Andrzej Kapolka 028b53df68 If a message is too big to be sent as a datagram, fall back to
sending it on the stream.  However, also increase the maximum 
datagram size.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5670 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-02-24 22:58:22 +00:00
Dave Hoover e6180d359d Clean up a couple warnings
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5618 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-05 18:37:33 +00:00
Michael Bayne 581230b9a2 Operate on a snapshot of the overflow queue values as a connection may fail
while we're processing its overflow messages, which causes its overflow queue
to be cleared which causes a ConcurrentModificationException.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5613 542714f4-19e9-0310-aa3c-eee0fc999fb1
2009-01-03 00:41:53 +00:00
Michael Bayne 034284e103 Tuple.create -> Tuple.newTuple.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5559 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-18 21:15:43 +00:00
Michael Bayne 201ab6adc7 Turn off the debug report for now.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5554 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-17 20:36:26 +00:00
Dave Hoover e1afaccd23 Cleanup some unused stuff & mark some overrides.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5547 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-12 18:46:06 +00:00
Michael Bayne f4544ff76e Include current connection and handler count in our conmgr stats.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5539 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 18:47:58 +00:00
Michael Bayne a0cc2fd348 Nixed the notion of a ConnectionObserver. The only observer was the
ClientManager and it is already pretty tightly coupled to the ConnectionManager
so we weren't really fooling anyone with that ham-fisted attempt at
abstraction.

Also cleaned up more mid-shutdown behavior. If a session is unmapped after the
omgr exits, avoid generating a warning by trying to hop onto the omgr thread to
clean up after ourselves. We still do all the actual socket related closing so
that the party on the other end of the socket benefits from a clean shutdown
where possible.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5537 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 01:52:29 +00:00
Michael Bayne 2c0ca57551 Nix startup listener since that was only being used to shut everything down if
we fail to bind to any of our desired ports. We'll just do that automatically
because no one wants a totally hapless server sitting around unable to actually
accept any connections.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5536 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 01:04:08 +00:00
Michael Bayne 641967564c A bit of tidying. Move the shutdown related methods below all the methods
dealing with normal operation.

Nixed getFlattener() in favor of createDatagramSequencer() so that the
ConnectionManager doesn't have to expose its guts quite so much.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5535 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 00:54:59 +00:00
Michael Bayne 22762a5aa9 Added a count of how many socket events we see (sockets reporting ACCEPTable or
READable), tidied up some other bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5534 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 00:31:31 +00:00
Michael Bayne 58123a4df1 Added ConMgrStats.closes. Added code to dump conmgr stats to the log every 30
seconds so that we can see more about what's going on if we manage to recreate
our freakoutery.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5532 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 00:21:15 +00:00
Michael Bayne 9e1510c37d Some useful logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5526 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-08 02:34:19 +00:00
Michael Bayne 38e352443f Nixed more debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5513 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:27:12 +00:00
Michael Bayne c81f970590 Nixed debug logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5512 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:26:59 +00:00
Michael Bayne c4909a5a5c We need to start our connect() process on the conmgr thread and we also need to
properly handle a connecting connection becoming idle.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5511 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:21:02 +00:00
Michael Bayne 89f02fc728 Created ServerCommunicator which does all I/O using the ConnectionManager's
polled socket system. This much more cleanly and efficiently integrates peer
(and other server to server) connections into the normal server I/O framework
and should also eliminate for good the annoying server hangs that result when
our old blocking client I/O threads got their pants wedged.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5510 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 00:27:07 +00:00
Jamie Doornbos 7a3f264d43 Minor changes to previous fix. Log runnable, event or message that is being posted to the inactive queue. Remove instanceof check since the invoker will always be of the expected type
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5495 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 23:14:47 +00:00
Michael Bayne e843684637 Fix typo.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5494 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 23:01:45 +00:00
Michael Bayne f60713de17 Between the time that we're shutdown and the time that we finally exit, do not
accept new connections or read incoming messages from any of our extant
connections. Do send outgoing messages to those connections, but nothing else.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5493 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 23:00:07 +00:00
Jamie Doornbos e97d19476b Be less harsh and just log a warning in case some shutdown methods rely on posted events or messages being silently ignored (invoker still throws however, because it was throwing before)
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5492 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 22:49:25 +00:00
Jamie Doornbos 82d4f36c1a Fixes for shutdown sequence, including prevention of a race condition
* Throw an exception if any events, runnables or messages are posted after shutdown. These were previosuly being silently ignored. We really should know about them.
* Don't exit the connection manager thread until the object manager thread exits. This fixes a race condition where the wakeup time of the conmgr thread would determine if it shutdown before or after the object manager, meaning it would sometimes ignore messages around shutdown time.
* Add a shutdown constraint to make the client manager shutdown before the invoker/event/conmgr threads. This gives a single point in the shutdown sequence that applications can use as a constraint (TODO: shutdown groups?)
* Emit a log message for each shutdown method call. This could be very useful in production.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5491 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-03 22:20:16 +00:00
Michael Bayne ded19474bc Added foo/s to various report output.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5468 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-26 20:59:24 +00:00
Dave Hoover 657aafaedb And of course, if I were thinking this morning, I would've rerun the organize imports
thing before committing instead of just going "oh yeah, I've been having this stuff
sitting around uncommitted for a while waiting on it to be blessed" and missing
out on things that'd changed in the meantime.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5400 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-26 17:35:29 +00:00
Dave Hoover 8856120403 Import cleanups
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5399 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-26 17:29:59 +00:00
Dave Hoover 7ee6ace683 Javadoc warnings cleanups.
Note: this involves generated code from a samskivert patch I only just sent to mdb,
but he's in a meeting, so that won't show up for a little.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5369 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-09-12 17:59:26 +00:00
Michael Bayne fcedbe90d7 Thread.dumpStack() circumvents whatever logging is configured and writes
directly to stderr. Logging an exception with the associated warning does the
right thing and logs the stack trace via the logging system.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5318 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-08-13 17:35:37 +00:00
Michael Bayne 0a893e1de1 ZOMG, Narya now perfectly passes our coding standards as enforced by
CheckStyle. The checks are slightly looser than I'd like but way better than
nothing and we get a bunch of other useful warnings like shadowed names and
other handy bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5253 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 14:36:54 +00:00
Michael Bayne c743432676 More style changes.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5248 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-22 13:02:13 +00:00
Dave Hoover 6b1d65553f And finally, narya gets the imports/overrides/regen love.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5241 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-07-18 23:20:17 +00:00
Michael Bayne 4eb86aec71 Supply our default authenticator by making the binding optional rather than by
binding the default in PresentsServer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5165 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 14:34:16 +00:00
Michael Bayne 8c37ca7bfa Three things:
- Inject the auth Invoker.
- Inject the Authenticator and formalize the chaining authenticator pattern.
- Simplify PeerNode creation and make the PeerAuthenticator a chainer.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5162 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-08 13:04:27 +00:00