Commit Graph

82 Commits

Author SHA1 Message Date
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
Michael Bayne dd1f895190 Handle the situation where a referred object and the referring object are
both destroyed without any intervening event processing.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3186 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-10-28 21:59:00 +00:00
Michael Bayne a9720fd905 LGPLed the library. Hello world.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3099 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-27 02:21:06 +00:00
Michael Bayne bfc0fbcd3e Removed DObject dump as that is now handled by the tracked object dump.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3090 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-08-23 21:01:36 +00:00
Michael Bayne 212ebb1b53 As Ray pointed out, clearing the oid upon destruction causes problems, so
let's just not do it. We can accomplish our earlier goals, though with
slightly less distinction making capability, in a different way.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3050 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-07 03:10:24 +00:00
Michael Bayne 90e5231bae When a DObject is destroyed, set its oid to -1 so that it knows that it
was once alive but is now gone. Catch attempts to start a transaction on a
destroyed object and log them as such. Made isDestroyed() and isActive()
final for wholly unfounded performance reasons.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3045 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-07-03 07:16:56 +00:00
Michael Bayne e1d5b096ed Invoker refactoring.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3041 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-06-29 03:22:22 +00:00
Michael Bayne ebdf693143 Log the culprit when we report and continue from a fatal error.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2963 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-21 02:18:56 +00:00
Michael Bayne a26e460fd6 Catch fatal errors thrown by invoker units as well. Also only log the
stack trace if we're not going to rethrow the error.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2958 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-21 00:22:30 +00:00
Michael Bayne 813e7b0d47 Attempt to catch and recover from fatal errors. If some rogue event
listener tries to 'new int[Integer.MAX_VALUE]' or infinitely loop, they
will get the smack down and we will go on about our business.

If things have actually gone pear shaped and we are failing on every
event, we'll hit the 30 fatal events in 60 seconds cap and stick a fork in
ourselves.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2957 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-21 00:04:40 +00:00
Michael Bayne 66b627ef2c Incorporated profiles into the 15 minute dump; removed some vestigal
constants.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2952 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-09 02:13:35 +00:00
Michael Bayne 1d97122a81 Use the fine grained timer (measure in microseconds rather than
milliseconds) and same every 100th event instead of profiling every event.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2951 542714f4-19e9-0310-aa3c-eee0fc999fb1
2004-02-09 02:08:28 +00:00
Michael Bayne f013aba02b Additional robustness: mark the server dobjmgr internal events as private
and refuse subscriptions to invalid oids (it's not out of the realm of
possibility that the clients were somehow subscribing to oid 0 and funny
things were happening).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2778 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-16 04:14:56 +00:00
Michael Bayne 6c1274eef3 This should never be sent over the wire, but it is somehow, sometimes, and
by making these transient we can hopefully debug it more effectively if it
happens in the future.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2773 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-15 18:50:02 +00:00
Ray Greenwell b59b9b5954 New very safe shutdown scheme. An Invoker.Unit runs on both the Invoker
and dobj thread until they're both empty (or it has been passed 50 times)
and then shuts the threads down.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2744 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-08-08 03:11:55 +00:00
Michael Bayne 8e158dd1e8 Let's get the class name in there as well.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2660 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-15 16:47:33 +00:00
Michael Bayne 7d98a59c1c Enable unit profiling and keep an eye out for exceptionally long running
units.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2652 542714f4-19e9-0310-aa3c-eee0fc999fb1
2003-06-12 22:10:07 +00:00