Commit Graph

4317 Commits

Author SHA1 Message Date
Jamie Doornbos 0f8c7d8f4c Get the trace for that pesky NPE in Client.Reader.receiveMessage
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5540 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 18:53:48 +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
Jamie Doornbos 2014f8c906 Prevent calling observers with a null client
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5538 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 18:43:29 +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 065e5918e7 Comment clarification. Only the PresentsInvoker coordinates with the
PresentsDObjectMgr to achieve a coordinated shutdown.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5531 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 00:14:48 +00:00
Michael Bayne f71613e3d6 We go to all the trouble of implementing ShutdownManager.Shutdowner, let's go
ahead and actually register ourselves with the ShutdownManager.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5530 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-11 00:13:39 +00:00
Michael Bayne 64115155ec Shut down our flusher when we're cleaned up.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5529 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-08 03:35:02 +00:00
Michael Bayne fd74fa955f Don't append a null if we're clearing out a local attribute that's not set.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5528 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-08 03:21:12 +00:00
Michael Bayne 27f6675acf We're having issues with the ServerCommunicator. Let's roll back to the
blocking version while we investigate.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5527 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-08 02:42:21 +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
Andrzej Kapolka 3be495e23b Added a note indicating that only references to streamable
classes can be streamed.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5525 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-08 02:17:20 +00:00
Andrzej Kapolka 28c7609df8 Allow streaming Class references.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5524 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-08 01:57:42 +00:00
Charlie Groves a5a8272900 Cancel the shutdowner at the end of didShutdown in case shutting down emptied the room and caused it to schedule.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5522 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 22:44:25 +00:00
Michael Bayne deb8d90e07 Fail fast on fuckup.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5521 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 19:18:02 +00:00
Michael Bayne 4ab8689ea9 Allow additional identifying arguments to be passed to the PersistingUnit for
use when logging failure.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5520 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 19:12:45 +00:00
Michael Bayne 2187609696 Stop our tick interval in cleanup() rather than logoff(). Logoff is not always
initiated by the client, but we always want to stop our ticking.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5519 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 18:46:36 +00:00
Jamie Doornbos aa44d90aab Fixed log warning for failed persistence. It was not logging the exception in the correct slot and was using the name of the unit in the message rather than in brackets.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5518 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 18:40:14 +00:00
Michael Bayne 9a6e3e9fe9 Temporary fix for the local server timing out outgoing connections. I don't
think it should be needed but I need to do more testing, post-bling.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5517 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 03:14:46 +00:00
Michael Bayne eeb87f0721 Some new-style logging.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5516 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:50:58 +00:00
Michael Bayne 93d36c045f Small tidying.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5515 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:44:21 +00:00
Michael Bayne 01ac320432 When a peer connects to us, turn around and immediately connect back to them.
Don't wait up to 60 seconds for the next peer refresh interval.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5514 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-07 01:33:23 +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
Michael Bayne b81ccde75b ClientFactory -> SessionFactory, etc.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5509 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:24:44 +00:00
Michael Bayne c69630b7e0 PresentsClient -> PresentsSession (Jamie's suggestion) and associated changes
on down the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5508 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-06 18:04:42 +00:00
Par Winzell f17e0efd07 The throttle update cannot be applied in a Runnable, or we get a race condition against the frames coming in from network. The actual _throttle is only ever access from the network thread, so only _pendingThrottles needs extra care.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5501 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 19:55:06 +00:00
Jamie Doornbos 14755a6cea Fixed fundamental flaw with throttling code. Changed the client to adjust its message rate when it actually sends the throttle updated message. Otherwise the client starts sending at the new rate before the server knows about it. Keep the messages per second in the message.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5499 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-04 08:37:13 +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
Jamie Doornbos 055ae0cc98 Allow bureau clients to report fatal errors if something goes wrong, like oh I don't know... maybe a disconnection perhaps
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5489 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-11-01 00:31:53 +00:00
Mike Thomas dc99a123ad Helps if we actually call the function that's able to be overridden.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5488 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 21:46:47 +00:00
Charlie Groves 0906ccdca5 Things work better when you set values and whatnot
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5487 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 20:31:51 +00:00
Charlie Groves 15c66260ea Take ChangeListeners in SafeSubscriber's constructor that will start listening
to the subscribed object when it becomes available and will stop listening when
we unsubscribe.



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5486 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 18:33:59 +00:00
Michael Bayne a3e74276f5 Implement these listeners in helper classes rather than in ourselves where they
become undesirably part of our public interface.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5485 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-31 17:33:26 +00:00
Michael Bayne 7d4a594929 Truth in method naming.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5484 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-30 22:31:15 +00:00
Mike Thomas f511469901 Purge the use of the getChatName() hack.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5482 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-29 22:26:56 +00:00
Mike Thomas 815f7b5b44 Allow the output stream to be overridden just like the input stream on the config registry.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5481 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 22:47:13 +00:00
Michael Bayne 677e06b193 Let's have a nice toString().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5480 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 22:16:38 +00:00
Michael Bayne 7d5d10e2f8 Ray wants size() and I don't want mutators. I'll compromise and return an
immutable list.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5479 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:40:35 +00:00
Dave Hoover da52d29a0a Javadoc nitpickery
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5478 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:37:28 +00:00
Michael Bayne 826a1a0bcc Added getLocals().
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5477 542714f4-19e9-0310-aa3c-eee0fc999fb1
2008-10-28 20:25:08 +00:00