Commit Graph

111 Commits

Author SHA1 Message Date
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
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