aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Extend drop command to "debug lludp drop <in|out>..." to allow drop of ↵Justin Clark-Casey (justincc)2014-08-191-8/+17
| | | | | | inbound packets. For test/debug purposes.
* Add "debug lludp drop out <add|remove> <packet-name>" console command for ↵Justin Clark-Casey (justincc)2014-08-191-0/+49
| | | | | | | debug/test purposes. This drops all outbound packets that match a given packet name. Can currently only be applied to all connections in a scene.
* Add experimental OutgoingQueueRefillEngine to handle queue refill processing ↵Justin Clark-Casey (justincc)2014-08-191-2/+11
| | | | | | | | | | | on a controlled number of threads rather than the threadpool. Disabled by default. Currently can only be enabled with console "debug lludp oqre start" command, though this can be started and stopped whilst simulator is running. When a connection requires packet queue refill processing (used to populate queues with entity updates, entity prop updates and image queue updates), this is done via Threadpool requests. However, with a very high number of connections (e.g. 100 root + 300 child) a very large number of simultaneous requests may be causing performance issues. This commit adds an experimental engine for processing these requests from a queue with a persistent thread instead. Unlike inbound processing, there are no network requests in this processing that might hold the thread up for a long time. Early implementation - currently only one thread which may (or may not) get overloaded with requests. Added for testing purposes.
* Make LLUDPServer.Scene publicly gettable/privately settable instead of ↵Justin Clark-Casey (justincc)2014-08-191-49/+49
| | | | | | | protected so that other logging code in the clientstack can record more useful information Adds some commented out logging for use again in the future. No functional change.
* If a user moves back in sight of a child region before the agent has been ↵Justin Clark-Casey (justincc)2014-08-151-1/+1
| | | | closed on teleport, don't unnecessarily resend all avatar and object data about that region.
* On teleport to a region that already has a child agent established (e.g. a ↵Justin Clark-Casey (justincc)2014-08-151-1/+1
| | | | | | neighbour) don't resend all the initial avatar and object data again. This is unnecessary since it has been received (and data continues to be received) in the existing child connection.
* Only set up the UnackedMethod for an outgoing message if that message is ↵Justin Clark-Casey (justincc)2014-08-131-1/+3
| | | | actually meant to get an ack (because it's reliable).
* Added "debug packet --all" option, which changes the packet logging level ↵Oren Hurvitz2014-07-211-8/+26
| | | | | | for both current and future clients The existing "--default" option only changes the logging level for future clients.
* Fixed the logic that decides if a packet was queued (it was reversed)Oren Hurvitz2014-07-211-5/+6
|
* Add IncomingPacketsResentCount clientstack statisticsJustin Clark-Casey (justincc)2013-11-061-0/+23
| | | | | This records how many packets were indicated to be resends by clients Not 100% reliable since clients can lie about resends, but usually would indicate if clients are not receiving UDP acks at all or in a manner they consider timely.
* Start counting resent packets in the places that I missed when the stat was ↵Justin Clark-Casey (justincc)2013-10-311-0/+4
| | | | first added a few commits ago
* Add OutgoingPacketsResentCount clientstack stat.Justin Clark-Casey (justincc)2013-10-311-0/+27
| | | | | | This allows one to monitor the total number of messages resent to clients over time. A constantly increasing stat may indicate a general server network or overloading issue if a fairly high proportion of packets sent A smaller constantly increasing stat may indicate a problem with a particular client-server connection, would need to check "show queues" in this case.
* Comment out LLUDPServer.BroadcastPacket() to reduce code complexity. ↵Justin Clark-Casey (justincc)2013-10-241-38/+38
| | | | Appears to be a never used method.
* Only set the data present event if we actually queued an outoing packet (not ↵Justin Clark-Casey (justincc)2013-10-241-4/+17
| | | | if we sent immediately)
* refactor: Rename Scene.AddNewClient() to AddNewAgent() to make it obvious in ↵Justin Clark-Casey (justincc)2013-09-271-1/+1
| | | | the code that this is symmetric with CloseAgent()
* refactor: rename Scene.IncomingCloseAgent() to CloseAgent() in order to make ↵Justin Clark-Casey (justincc)2013-09-271-2/+2
| | | | | | it clear that all non-clientstack callers should be using this rather than RemoveClient() in order to step through the ScenePresence state machine properly. Adds IScene.CloseAgent() to replace RemoveClient()
* Reinsert client.SceneAgent checks into ↵Justin Clark-Casey (justincc)2013-09-251-11/+26
| | | | | | | | LLUDPServer.HandleCompleteMovementIntoRegion() to fix race condition regression in commit 7dbc93c (Wed Sep 18 21:41:51 2013 +0100) This check is necessary to close a race condition where the CompleteAgentMovement processing could proceed when the UseCircuitCode thread had added the client to the client manager but before the ScenePresence had registered to process the CompleteAgentMovement message. This is most probably why the message appeared to get lost on a proportion of entity transfers. A better long term solution may be to set the IClientAPI.SceneAgent property before the client is added to the manager.
* Reinsert 200ms sleep accidentally removed in commit 7dbc93c (Wed Sep 18 ↵Justin Clark-Casey (justincc)2013-09-251-2/+2
| | | | 21:41:51 2013 +0100)
* Double the time spent waiting for a UseCircuitCode packet in ↵Justin Clark-Casey (justincc)2013-09-181-1/+1
| | | | | | | | | LLUDPServer.HandleCompleteMovementIntoRegion() This is to deal with one aspect of http://opensimulator.org/mantis/view.php?id=6755 With the V2 teleport arrangements, viewers appear to send the single UseCircuitCode and CompleteAgentMovement packets immediately after each other Possibly, on occasion a poor network might drop the initial UseCircuitCode packet and by the time it retries, the CompleteAgementMovement has timed out and the teleport fails. There's no apparant harm in doubling the wait time (most times only one wait will be performed) so trying this.
* Change logging to provide more information on ↵Justin Clark-Casey (justincc)2013-09-181-10/+39
| | | | | | | LLUDPServer.HandleCompleteMovementIntoRegion() Add more information on which endpoint sent the packet when we have to wait and if we end up dropping the packet Only check if the client is active - other checks are redundant since they can only failed if IsActve = false
* Add stat clientstack.<scene>.IncomingPacketsOrphanedCount to record ↵Justin Clark-Casey (justincc)2013-08-141-4/+29
| | | | well-formed packets that were not initial connection packets and could not be associated with a connected viewer.
* Count any incoming packet that could not be recognized as an LLUDP packet as ↵Justin Clark-Casey (justincc)2013-08-141-21/+44
| | | | | | | a malformed packet. Record this as stat clientstack.<scene>.IncomingPacketsMalformedCount Used to detect if a simulator is receiving significant junk UDP Decimates the number of packets between which a warning is logged and prints the IP source of the last malformed packet when logging
* Fix an issue where under teleport v2 protocol, teleporting from regions in ↵Justin Clark-Casey (justincc)2013-08-081-3/+3
| | | | | | | | | | an line from A->B->C would not close region A when reaching C The root cause was that v2 was only closing neighbour agents if the root connection also needed a close. However, fixing this requires the neighbour regions also detect when they should not close due to re-teleports re-establishing the child connection. This involves restructuring the code to introduce a scene presence state machine that can serialize the different add and remove client calls that are now possible with the late close of the This commit appears to fix these issues and improve teleport, but still has holes on at least quick reteleporting (and possibly occasionally on ordinary teleports). Also, has not been completely tested yet in scenarios where regions are running on different simulators
* minor: Add name to debug lludp packet level feedback on consoleJustin Clark-Casey (justincc)2013-08-011-1/+1
|
* Try a different approach to slow terrain update by always cycling the loop ↵Justin Clark-Casey (justincc)2013-08-011-1/+2
| | | | | | | | immediately if any data was sent, rather than waiting. What I believe is happening is that on initial terrain send, this is done one packet at a time. With WaitOne, the outbound loop has enough time to loop and wait again after the first packet before the second, leading to a slower send. This approach instead does not wait if a packet was just sent but instead loops again, which appears to lead to a quicker send without losing the cpu benefit of not continually looping when there is no outbound data.
* Revert "Issue: painfully slow terrain loading. The cause is commit ↵Justin Clark-Casey (justincc)2013-08-011-5/+5
| | | | | | d9d995914c5fba00d4ccaf66b899384c8ea3d5eb (r/23185) -- the WaitOne on the UDPServer. Putting it back to how it was done solves the issue. But this may impact CPU usage, so I'm pushing it to test if it does." This reverts commit 59b461ac0eaae1cc34bb82431106fdf0476037f3.
* Issue: painfully slow terrain loading. The cause is commit ↵Diva Canto2013-08-011-5/+5
| | | | d9d995914c5fba00d4ccaf66b899384c8ea3d5eb (r/23185) -- the WaitOne on the UDPServer. Putting it back to how it was done solves the issue. But this may impact CPU usage, so I'm pushing it to test if it does.
* minor: Add timeout secs to connection timeout message. Change message to ↵Justin Clark-Casey (justincc)2013-07-291-8/+9
| | | | reflect it is a timeout due to no data received rather than an ack issue.
* Fix issue just introduced in 8efe4bfc2ed7086e9fdf4812297e6525f955f6ac where ↵Justin Clark-Casey (justincc)2013-07-291-1/+1
| | | | I accidentally left in a test line to force very quick client unack
* Make "abnormal thread terminations" into "ClientLogoutsDueToNoReceives" and ↵Justin Clark-Casey (justincc)2013-07-291-5/+21
| | | | | | | add this to the StatsManager This reflects the actual use of this stat - it hasn't recorded general exceptions for some time. Make the sim extra stats collector draw the data from the stats manager rather than maintaing this data itself.
* Deleted all [ZZZ] debug messages.Diva Canto2013-07-241-5/+0
|
* One more thing to test in order to let CompleteMovement go up the stack.Diva Canto2013-07-241-2/+3
|
* Minor adjustment on timings of waits.Diva Canto2013-07-241-4/+19
|
* New Teleport protocol (V2), still compatible with V1 and older. (version of ↵Diva Canto2013-07-241-0/+68
| | | | | | | | the destination is being checked) In this new protocol, and as committed before, the viewer is not sent EnableSimulator/EstablishChildCommunication for the destination. Instead, it is sent TeleportFinish directly. TeleportFinish, in turn, makes the viewer send a UserCircuitCode packet followed by CompleteMovementIntoRegion packet. These 2 packets tend to occur one after the other almost immediately to the point that when CMIR arrives the client is not even connected yet and that packet is ignored (there might have been some race conditions here before); then the viewer sends CMIR again within 5-8 secs. But the delay between them may be higher in busier regions, which may lead to race conditions. This commit improves the process so there are are no race conditions at the destination. CompleteMovement (triggered by the viewer) waits until Update has been sent from the origin. Update, in turn, waits until there is a *root* scene presence -- so making sure CompleteMovement has run MakeRoot. In other words, there are two threadlets at the destination, one from the viewer and one from the origin region, waiting for each other to do the right thing. That makes it safe to close the agent at the origin upon return of the Update call without having to wait for callback, because we are absolutely sure that the viewer knows it is in th new region. Note also that in the V1 protocol, the destination was getting UseCircuitCode from the viewer twice -- once on EstablishAgentCommunication and then again on TeleportFinish. The second UCC was being ignored, but it shows how we were not following the expected steps...
* Add proper method doc and comments to m_dataPresentEvent (from d9d9959)Justin Clark-Casey (justincc)2013-07-231-2/+13
|
* Add clientstack.InboxPacketsCount stat. This records the number of packets ↵Justin Clark-Casey (justincc)2013-07-231-0/+13
| | | | | | waiting to be processed at the second stage (after initial UDP processing) If this consistently increases then this is a problem since it means the simulator is receiving more requests than it can distribute to other parts of the code.
* Add clientstack.OutgoingUDPSendsCount stat to show number of outbound UDP ↵Justin Clark-Casey (justincc)2013-07-231-3/+15
| | | | packets sent by a region per second
* Record raw number of UDP receives as clientstack.IncomingUDPReceivesCountJustin Clark-Casey (justincc)2013-07-231-0/+13
|
* Add AverageUDPProcessTime stat to try and get a handle on how long we're ↵Justin Clark-Casey (justincc)2013-07-231-2/+17
| | | | | | | | taking on the initial processing of a UDP packet. If we're not receiving packets with multiple threads (m_asyncPacketHandling) then this is critical since it will limit the number of incoming UDP requests that the region can handle and affects packet loss. If m_asyncPacketHandling then this is less critical though a long process will increase the scope for threads to race. This is an experimental stat which may be changed.
* Added check for user movement specification before discarding an incomingRobert Adams2013-07-221-1/+2
| | | | | | AgentUpdate packet. This fixes the problem with vehicles not moving forward after the first up-arrow. Code to fix a potential exception when using different IClientAPIs.
* Fixed the stats in show client stats. Also left some comments with ↵Diva Canto2013-07-211-0/+2
| | | | observations about AgentUpdates.
* Make the check as to whether any particular inbound AgentUpdate packet is ↵Justin Clark-Casey (justincc)2013-07-211-2/+15
| | | | | | significant much earlier in UDP processing (i.e. before we pointlessly place such packets on internal queues, etc.) Appears to have some impact on cpu but needs testing.
* Hack in console command "debug lludp toggle agentupdate" to allow ↵Justin Clark-Casey (justincc)2013-07-211-0/+24
| | | | | | | | AgentUpdate in packets to be discarded at a very early stage. Enabling this will stop anybody from moving on a sim, though all other updates should be unaffected. Appears to make some cpu difference on very basic testing with a static standing avatar (though not all that much). Need to see the results with much higher av numbers.
* Fix up a temporary debugging change from last commit which stopped "lludp ↵Justin Clark-Casey (justincc)2013-07-211-2/+1
| | | | stop out" from actually doing anything
* Do some simple queue empty checks in the main outgoing udp loop instead of ↵Justin Clark-Casey (justincc)2013-07-211-2/+2
| | | | | | | always performing these on a separate fired thread. This appears to improve cpu usage since launching a new thread is more expensive than performing a small amount of inline logic. However, needs testing at scale.
* try Hacking in an AutoResetEvent to control the outgoing UDP loop instead of ↵Justin Clark-Casey (justincc)2013-07-181-2/+8
| | | | | | a continuous loop with sleeps. Does appear to have a cpu impact but may need further tweaking
* Revert the revertDiva Canto2013-07-151-0/+2
| | | | | | Revert "Trying to hunt the CPU spikes recently experienced." This reverts commit ac73e702935dd4607c13aaec3095940fba7932ca.
* Trying to hunt the CPU spikes recently experienced.Diva Canto2013-07-151-2/+0
| | | | | | Revert "Comment out old inbound UDP throttling hack. This would cause the UDP" This reverts commit 38e6da5522a53c7f65eac64ae7b0af929afb1ae6.
* Moved SendInitialDataToMe to earlier in CompleteMovement. Moved ↵Diva Canto2013-07-131-1/+1
| | | | | | | | TriggerOnMakeRootAgent to the end of CompleteMovement. Justin, if you read this, there's a long story here. Some time ago you placed SendInitialDataToMe at the very beginning of client creation (in LLUDPServer). That is problematic, as we discovered relatively recently: on TPs, as soon as the client starts getting data from child agents, it starts requesting resources back *from the simulator where its root agent is*. We found this to be the problem behind meshes missing on HG TPs (because the viewer was requesting the meshes of the receiving sim from the departing grid). But this affects much more than meshes and HG TPs. It may also explain cloud avatars after a local TP: baked textures are only stored in the simulator, so if a child agent receives a UUID of a baked texture in the destination sim and requests that texture from the departing sim where the root agent is, it will fail to get that texture. Bottom line: we need to delay sending the new simulator data to the viewer until we are absolutely sure that the viewer knows that its main agent is in a new sim. Hence, moving it to CompleteMovement. Now I am trying to tune the initial rez delay that we all experience in the CC. I think that when I fixed the issue described above, I may have moved SendInitialDataToMe to much later than it should be, so now I'm moving to earlier in CompleteMovement.
* Comment out old inbound UDP throttling hack. This would cause the UDPRobert Adams2013-07-091-0/+2
| | | | | | | reception thread to sleep for 30ms if the number of available user worker threads got low. It doesn't look like any of the UDP packet types are marked async so this check is 1) unnecessary and 2) really crazy since it stops up the reception thread under heavy load without any indication.