Commit Graph

98 Commits

Author SHA1 Message Date
Michael Bayne 5b5d39601b Added requireEventThread and refuseEventThread.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5213 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-30 11:36:17 +00:00
Michael Bayne 61fda944f8 Scratch that, do things more sneakily to avoid this circular dependence which
seems to cause some freakoutery.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5173 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-06-09 00:57:29 +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 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
Michael Bayne 63db77667a Some type safety, redundant cast removal, and other code hygiene.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4879 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-11-24 19:40:19 +00:00
Mike Thomas b3678b086d The client manager was busy registering client objects on the ConnectionManager thread rather than the dobj thread. Give it a nudge in the right direction.
Also, added logging to the PresentsDObjectMgr to check for this type of thing and dump stack if anyone is trying to register objects anywhere but the DObj thread (assuming we're sufficiently far started up that there is one).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4832 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-28 18:35:20 +00:00
Michael Bayne 93c89fe0a7 Be sure that we always dispatch subscription responses (success or failure) on
the dobjmgr thread to relieve the caller of the burden of knowing what thread
they are on.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4826 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-09-14 18:17:50 +00:00
Michael Bayne 20e70a9735 Log the registration and clearing of proxied object as we're seeing some
strangeness in production on Bang.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4738 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-15 16:44:09 +00:00
Michael Bayne 2fa6146d93 Have CompoundEvent handle propagating setTargetOid() to its internal events and
clean things up for the callers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4731 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-06-13 23:15:20 +00:00
Michael Bayne 9bcca099ac Implemented a Ray-proposed solution where we keep track of events that were
(pre-applied and) posted before we received our object but processed (and hence
dispatched to us) after we received our object.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4715 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-05-18 03:37:14 +00:00
Michael Bayne d61083db7e Fixed another beans frank problem.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4659 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-10 01:01:07 +00:00
Michael Bayne 32a97f5b18 Or we'll just fix the bug. How did any of this ever work?
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4658 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-10 00:54:20 +00:00
Michael Bayne b24fd5c408 Log the local oid assigned to all proxied objects so that we can see if
something funny is happening with spurious objects dispatched across servers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4657 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-04-10 00:51:17 +00:00
Michael Bayne 99662df60f Safety first!
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4635 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-03-25 17:14:44 +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 3c4f1728d5 Allow a unit to express that it's going to take a long time and should not be
complained about.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4599 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-23 19:52:50 +00:00
Michael Bayne a1be45996b Implemented the mechanism for initiating and clearing out a remote object
proxy. Untested, but hey, it probably works. :)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4543 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-08 19:43:55 +00:00
Michael Bayne e1c5d01afd Added proxied object support to the distributed object manager framework. This
exposes the need to write a Client that is optimized to act as a proxy instead
of just using the one that is designed to run on a user's machine. However,
this will be fine for now. Integration with PeerManager forthcoming.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4530 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-03 01:14:17 +00:00
Michael Bayne cadde41ccb Widening in preparation for modifications.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4523 542714f4-19e9-0310-aa3c-eee0fc999fb1
2007-02-02 22:38:19 +00:00
Michael Bayne 48faea2ace All VirtualMachineErrors seem worthy of fork sticking. Also re: my previous
checkin, tihs will be a non-issue when we start devoting an entire separate JVM
to each game (which we will have to do for all games that run server code)
because then all a game can do is stick a fork in its own JVM and render itself
unplayable.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4388 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-29 00:45:58 +00:00
Michael Bayne 57edcd84b6 We have to specifically enumerate the scary errors that we'll let actually
stick a fork in the server otherwise malicious or broken code can generate an
AbstractMethodError or some other error and cause the server to decide to quit.

It may still be possible for malicious code to throw an OutOfMemory error, and
if that's the case then I don't know what we can do to both gracefully get the
fuck out of dodge when things are pear shaped and avoid the wrath of the
kiddies.

Incidentally, it was stupidity, not malice that brought this to my awareness.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4387 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-09-29 00:41:33 +00:00
Michael Bayne bc9f53396c Revamped distributed object creation. There was no particular reason to create
distributed objects by reflection since we don't allow clients to create
objects, furthermore we needn't do it asynchronously. The object creation
methods were moved into the server-side only interface and made "immediate", so
the caller creates a derived instance of DObject and registers it with the
system instead of creating it with a Subscriber callback.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4342 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-08-23 23:46:48 +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 012549d177 Differentiate between interactive reports and periodically generated reports.
Only reset our accumulating counters for the periodic reports.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4219 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-25 23:03:51 +00:00
Michael Bayne 091fda3e77 Revamped stats tracking so that it all happens on the same reporting interval.
Turned off the very verbose unit profiles as we don't currently use them. Wired
up SIGUSR1 to dump a report to the log.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4218 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-06-25 22:47:42 +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
Michael Bayne b2896dc7ff Minna daisuki type safety.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4075 542714f4-19e9-0310-aa3c-eee0fc999fb1
2006-04-28 18:29:46 +00:00
Ray Greenwell 0e60a76e2b Interval.Runnable -> Interval.RunBuddy
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3775 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-12-05 19:41:44 +00:00
Ray Greenwell bd7c2caab9 Use new Interval.Runnable interface name.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3728 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-10-12 21:02:18 +00:00
Michael Bayne 7fb4eafbf8 How have we not previously been screwed by the fact that an Error (like
NoSuchMethodError) sticks a fork in the event dispatcher thread?


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3712 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-27 04:38:33 +00:00
Michael Bayne dd44bb4f69 Removed unneeded and improper Runnable check.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3696 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-06 18:32:37 +00:00
Michael Bayne 5502936535 Instead of relying on toString() returning something sensible, we go back
to using the class name but get the appropriate class in the case of
RunQueue queued intervals.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3695 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-06 18:20:22 +00:00
Ray Greenwell 92e4e9cfaf There are zillions of invocation dispatchers registered with a multitude
of codes. Currently the unit dump that is done once every 15 minutes is
chock-full of one-off units. Let us report the short class name of
the dispatcher, rather than the code with which an instance is registered.

Also: Thou shalt always iterate over the entrySet of a Map if thou planneth
to utilize both the key and the value.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3694 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-09-05 05:38:58 +00:00
Michael Bayne b7f02502aa Track max queue size and total events dispatched in an extensible stats
object that can be (and is) provided to external callers.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3688 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-08-24 18:28:36 +00:00
Michael Bayne 5fbb02bc34 Decode InvocationRequestEvent information as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3676 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-08-08 23:59:27 +00:00
Michael Bayne d30119eb65 Do some jiggery pokery to better classify the zillions of Interval$Unit$1
runnables that get added to the dobjmgr queue.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3675 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-08-08 23:54:41 +00:00
Michael Bayne a940d490a8 Switch to filterable log format.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3622 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-24 20:36:53 +00:00
Michael Bayne eec8a2ceb9 Record our queue size once every five minutes, and do it using a nice
happy constant.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3595 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-13 18:42:29 +00:00
Michael Bayne 457729fdcb Record the maximum distributed object and invoker queue size every minute
to a specific stats log.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3594 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-06-13 18:16:56 +00:00
Ray Greenwell b80eec3959 Don't let our max queue reporting drift a few ms every minute.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3472 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-12 19:04:39 +00:00
Michael Bayne d1a19cc346 Don't report the first time, just set our next report stamp.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3470 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-12 17:46:14 +00:00
Michael Bayne 25b84d1ed6 Allow queue reporting to be activated programmatically. Fixed bug.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3469 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-12 17:40:13 +00:00
Michael Bayne 7c24e70523 Added code to track the largest event queue size and report it every
minute if so instructed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3468 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-12 17:33:55 +00:00
Michael Bayne 5507f1a857 Report long units in milliseconds.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3467 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-04-12 17:16:58 +00:00
Ray Greenwell a784ce8a79 Comment change so that I can check it in with the right umask.. grr.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3370 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-26 14:30:52 +00:00
Ray Greenwell 008b9ad896 When a new default access controller is set, switch any objects
that were using the old default (usually null) to use the new default.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3369 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-26 14:04:25 +00:00
Michael Bayne 121f6d7e53 Did the refactoring necessary to get the client and server to live happily
together in one JVM and both interoperate with the AWT thread in a manner
so harmonious as to bring a tear to the eye. This was surprisingly much
easier that I expected, thanks to my eminently sensible initial design,
I'm sure. ;)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3360 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-02-20 00:37:34 +00:00
Michael Bayne afabea71ad Big fat Bernie javadoc cleanup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3310 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 23:08:21 +00:00
Michael Bayne be93e5eb12 Make sure to catch any error while processing our events, not just when
actually dispatching the event to subscribers. We can't trust anyone.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3308 542714f4-19e9-0310-aa3c-eee0fc999fb1
2005-01-24 07:59:31 +00:00
Ray Greenwell bd80c348eb The great Interval revamp.
There is no more SafeInterval, instead Intervals can be constructed with a RunQueue to use for expiring.
PresentsDObjectMgr implements RunQueue.
Client has a getRunQueue() method to get the client side RunQueue.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3283 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-12-22 19:23:00 +00:00