Commit Graph

97 Commits

Author SHA1 Message Date
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
Michael Bayne fce06c52c5 Actually instead of doing the necessary jiggery pokery to make PresentsServer
subclasses provide PresentsServer "services" we'll just have no PresentsServer
services. All services will be provided by components and the server will
disappear in a puff of inversion of control.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5155 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-07 18:57:04 +00:00
Michael Bayne 3aefc93838 Holy fruity beverage Batman! I'm taking the plunge and switching to Guice for
dependency resolution and management. Things are currently in a state of
transition, but the important patterns have been established and I'll aim to
sweep through all of Narya, Nenya and Vilya in the near future and do
everything properly.

Going through the other million-odd lines of code we have scattered across our
various projects that use these libraries is not something I plan to do, so
we'll be maintaining backward compatibility with the old static member method,
though I hope to strive toward eradication of that usage entirely in MSOY while
we still have a fighting chance.

Given that some of our projects will continue to use the static member method
in perpetuity, I'm not going to @Deprecate those fields because that would fill
their logs with so much spam that they'd have to turn off deprecation warnings
which would make life worse for them. So instead we'll settle for the big scary
comment warning people away from the old bits.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5153 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-07 17:44:48 +00:00
Michael Bayne 02b2c67991 Name the connection manager thread.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5146 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-30 12:20:58 +00:00
Michael Bayne 919112cf88 Switch to new samskivert logging API.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5134 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-27 19:25:38 +00:00
Andrzej Kapolka ee74481cad Much work on generalizing the notion of message "transport" and
allowing the use of annotations to customize transport for 
DObject fields and service/receiver methods.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5099 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-16 01:47:33 +00:00
Andrzej Kapolka 9bafa5e7c8 Basic support for datagram messaging. Hope I haven't fucked
anything up!


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5090 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-05-13 21:12:39 +00:00
Dave Hoover 2ce35db583 Remove unneeded casts.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4923 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-01-17 01:25:52 +00:00
Dave Hoover baa664bd11 channel is a SocketChannel which is a subclass of SelectableChannel, so this instanceof
can't ever be false. (And just above, we've already confirmed that channel != null, so this
check wasn't falling back to protecting us from that)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4867 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-08 18:49:28 +00:00
Michael Bayne a6be47fa83 Adjust the shutdown process to ensure that we can get messages generated during
the shutdown sequence out to our clients where desired.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4807 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-06 18:38:27 +00:00
Michael Bayne 0c5a4f6683 Useful error reporting.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4806 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-08-04 02:16:24 +00:00
Dave Hoover 3b701ef57d Tabs -> spaces
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4742 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-26 00:07:36 +00:00
Michael Bayne 6db6eef7e1 Close our bound socket when the connection manager is shutdown. New-styled
logging.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4727 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 17:48:42 +00:00
Michael Bayne 3546567824 Log the thread in question as we're seeing this warning on code that certainly
looks like it should be running on the dobjmgr thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4653 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-07 19:39:24 +00:00
Michael Bayne 63413f862c Widened, added sanity check to postMessage() to log a warning and stack trace
if it is called from any thread except the distributed object dispatch thread.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4647 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-06 18:29:42 +00:00
Michael Bayne 3ac5ab2e10 Reset the framing output stream before we write the message rather than after
in case we freak out in the middle of writing a message.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4645 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-05 17:20:53 +00:00
Michael Bayne 09f0bee0f3 Yet more header patrol.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4602 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-24 00:39:27 +00:00
Michael Bayne 8676bb1adc Avoid div0 in rare situation.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4382 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-27 16:54:13 +00:00
Michael Bayne f40325fa67 Revamped the way network stats are tracked so that they are all monotonically
increasing integers. Added tracking for connect and disconnect events.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4324 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-15 00:12:42 +00:00
Michael Bayne 8afd0316ec I decided to go hog wild and clean up all the type use in Presents which
required some serious bending and folding of the generic type system, but for
the most part we managed to avoid any mutilating. The gendobj task now
generates properly typed "addToXXX" and "updateXXX" DSet methods based on the
parameterized type of the DSet. This might cause unrecompiled code to break,
but I don't think there are many cases in the base toolkit where people call
DSet adders or updaters. We'll see and I'll add backwards compatibility
versions for cases where we need them to support GG games (everything else we
can just recompile).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4245 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-07-05 00:55:05 +00:00
Michael Bayne 0a5953bf17 Chipping away at proper type safety for all of the Narya code.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4232 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-27 17:46:36 +00:00
Michael Bayne 01e9b0457d Checking in some work I did on getting listening on port 443 working by
inheriting a socket channel inetd style. It doesn't actually work for annoying
reasons, but I figured I'd get the code in there and the type safety fixes and
maybe Sun will fix their stupid bug at some point (I should create a test case
and actually submit a bug report...).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4230 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-27 17:33:06 +00:00
Michael Bayne d40435b221 Accept and honor the reset parameter.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4220 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-25 23:09:19 +00:00
Ray Greenwell 79c6427c21 StringBuffer -> StringBuilder.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4191 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-13 22:42:20 +00:00
Ray Greenwell 07bc269f59 Bugfix for something that may never be needed in the wild: when an
AuthingConnection is replaced by a RunningConnection we need to transfer
over any associated overflow queue to the new connection object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3989 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-30 00:09:55 +00:00
Michael Bayne 23f531fa42 Removed overflow queue logging as this has all been running happily for almost
a year since the refactor that inspired leaving this logging in.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3961 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-03-18 00:41:53 +00:00
Ray Greenwell dc202b3e8a Let's find out what that invalid argument exception is, should it recur.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3665 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-08-01 18:11:33 +00:00
Michael Bayne 8c94273b69 Allow the connection manager to listen for incoming connections on
multiple ports.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3655 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-21 19:21:33 +00:00
Michael Bayne 9f470a4205 If we end up with a selectable channel in our selection set that we no
longer know about, request that it be given the boot when it rears its
ugly head.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3643 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-07-06 01:00:19 +00:00
Ray Greenwell ae0547a0ff Cope with the bug we observed this morning as best we can, shut down
the conmgr (and in so doing, the entire server).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3534 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-05-02 18:52:20 +00:00
Ray Greenwell 4c3dd9b1af Dodge the BSD bug with toStringing a channel.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3480 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-13 19:18:45 +00:00
Michael Bayne 09822e45c5 Don't log our channel in the normal case to avoid potentially triggering
what I believe to be a race condition in SocketChannel.toString()
(ultimately sun.nio.ch.Net.localAddress()) on FreeBSD.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3471 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-12 18:09:17 +00:00
Michael Bayne a4ac47fb04 Reinstated the Presents I/O refactor with the modification of ensuring
that authentication is processed on the dobjmgr thread rather than
requiring the caller to do the right thing (or not as the case happened to
be).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3433 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-28 21:49:19 +00:00
Ray Greenwell d58d1001ac Roll it all back.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3432 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-03-28 19:33:28 +00:00