Commit Graph

3559 Commits (fd050fca7caef83d72d00241d0c0db5c1ec5d1ff)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 8efe4bfc2e Make "abnormal thread terminations" into "ClientLogoutsDueToNoReceives" and 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.
2013-07-29 23:18:29 +01:00
Diva Canto 69975763d2 Several major improvements to group (V2) chat. Specifically: handle join/drop appropriately, invitechatboxes.
The major departure from flotsam is to send only one message per destination region, as opposed to one message per group member. This reduces messaging considerably in large groups that have clusters of members in certain regions.
2013-07-27 15:38:56 -07:00
Diva Canto 3dac92f345 Increased the rate of the PollServiceRequestManager to 0.5 secs (it was 1sec). Group chat is going over the EQ... Hopefully this won't increase CPU when there's nothing going on, but we need to watch for that. 2013-07-26 21:40:04 -07:00
Justin Clark-Casey (justincc) 056a6ee765 Fix regression tests relating to agent transfer by making simulator use last week's SIMULATOR/0.1 protocol for now. 2013-07-26 19:22:30 +01:00
Diva Canto 3891a8946b New Teleport protocol (V2), still compatible with V1 and older. (version of 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...
2013-07-24 14:27:58 -07:00
Justin Clark-Casey (justincc) 9a4a513b5e Correct issue where the last instance of a sampled stat was shown 3x larger than it should have been (though internal use was correct) 2013-07-23 23:31:35 +01:00
Justin Clark-Casey (justincc) 76e46d0158 Improve spacing between data and units on console stats display 2013-07-23 17:23:16 +01:00
Justin Clark-Casey (justincc) 90528c23d9 For stats which can show average change over time, show the last sample as well as the average.
This is somewhat cryptic at the moment, need to improve documentation.
2013-07-23 01:13:13 +01:00
Diva Canto b5ab0698d6 EDIT BEAMS!!! They had been missing from OpenSim since ever. Thanks to lkalif for telling me how to route the information. The viewer effect is under the distance filter, so only avatars with cameras < 10m away see the beams. 2013-07-21 09:01:44 -07:00
Diva Canto d5a1779465 Manage AgentUpdates more sanely:
- The existing event to scene has been split into 2: OnAgentUpdate and OnAgentCameraUpdate, to better reflect the two types of updates that the viewer sends. We can run one without the other, which is what happens when the avie is still but the user is camming around
- Added thresholds (as opposed to equality) to determine whether the update is significant or not. I thin these thresholds are ok, but we can play with them later
- Ignore updates of HeadRotation, which were problematic and aren't being used up stream
2013-07-21 09:00:42 -07:00
Diva Canto 18d5d8f5dd Removed verbose debug from previous commit 2013-07-21 09:00:08 -07:00
Diva Canto edafea6ae6 PollServiceRequestManager: changed the long poll from a Queue to a List. No need to dequeue and enqueue items every 1sec. 2013-07-21 08:59:48 -07:00
Diva Canto 98d47ea428 Delay the enqueueing of non-longpoll requests for 100ms. No need to have these requests actively on the processing queue if it seems they're not ready. 2013-07-21 08:57:16 -07:00
Diva Canto b5062ae7ee Changed the timoeut of EQ 502s (no events) to 50 secs. The viewer post requests timeout in 60 secs.
There's plenty of room for improvement in handling the EQs. Some other time...
2013-07-18 13:30:04 -07:00
Diva Canto 71b1511db5 Revert "Revert "I confuse myself. Let's try this variable name instead.""
This reverts commit 52dc7b2a96.
2013-07-18 12:25:47 -07:00
Diva Canto a22a4db5ce Revert "Revert "Do the same trick that dahlia did for Dequeue(timeout)""
This reverts commit 5495df7443.
2013-07-18 12:25:22 -07:00
Diva Canto 552b85d33d Revert "Revert "Putting the requests back in the queue while testing for count >0 is not the smartest move...""
This reverts commit 7127891957.
2013-07-18 12:25:04 -07:00
Diva Canto ad198a714c Revert "Revert "Didn't mean to commit this change in BlockingQueue.cs""
This reverts commit fda91d93da.
2013-07-18 12:24:43 -07:00
Diva Canto 9e35b069a4 Reverting the reverts I did yesterday. cpu-branch has now been
successfully tested, and I'm merging back those changes, which proved to
be good.
Revert "Revert "Cleared up much confusion in PollServiceRequestManager. Here's the history:""

This reverts commit fa2370b32e.
2013-07-18 12:23:27 -07:00
Dan Lake ae997fffee Merge branch 'master' of git://opensimulator.org/git/opensim 2013-07-18 02:28:36 -07:00
Dan Lake 6572847518 Added MinPoolThreads to ini [Startup] section to control SmartThreadPool. 2013-07-18 02:28:07 -07:00
Justin Clark-Casey (justincc) 077be8b496 Fix what apepars to be a bug in DoubleQueue<T>.Enqueue(Queue<T> q, T data) where the q parmater is ignored and everyghig is always placed on m_lowQueue.
No actual impact presently since nothing ends up calling EnqueueHigh()
2013-07-18 01:23:33 +01:00
Diva Canto fa2370b32e Revert "Cleared up much confusion in PollServiceRequestManager. Here's the history:"
This reverts commit e46459ef21.
2013-07-17 15:05:36 -07:00
Diva Canto fda91d93da Revert "Didn't mean to commit this change in BlockingQueue.cs"
This reverts commit 0f5b616fb0.
2013-07-17 15:05:16 -07:00
Diva Canto 7127891957 Revert "Putting the requests back in the queue while testing for count >0 is not the smartest move..."
This reverts commit f4317dc26d.
2013-07-17 15:04:27 -07:00
Diva Canto 5495df7443 Revert "Do the same trick that dahlia did for Dequeue(timeout)"
This reverts commit af792bc7f2.
2013-07-17 15:04:12 -07:00
Diva Canto 52dc7b2a96 Revert "I confuse myself. Let's try this variable name instead."
This reverts commit 1d3deda10c.
2013-07-17 15:03:40 -07:00
Diva Canto 519dba9a69 Revert "Now trying DoubleQueue instead of BlockingQueue for the PollServiceRequestManager."
This reverts commit 5f95f4d78e.
2013-07-17 15:03:16 -07:00
Diva Canto 5c54eb30ed Revert "This is a completely unreasonable thing to do, effectively defying the purpose of BlockingQueues. Trying this, to see the effect on CPU."
This reverts commit 5232ab0496.
2013-07-17 15:02:54 -07:00
Diva Canto 5232ab0496 This is a completely unreasonable thing to do, effectively defying the purpose of BlockingQueues. Trying this, to see the effect on CPU. 2013-07-17 14:36:55 -07:00
Diva Canto 5f95f4d78e Now trying DoubleQueue instead of BlockingQueue for the PollServiceRequestManager. 2013-07-17 14:09:04 -07:00
Diva Canto 1d3deda10c I confuse myself. Let's try this variable name instead. 2013-07-17 13:26:15 -07:00
Diva Canto af792bc7f2 Do the same trick that dahlia did for Dequeue(timeout) 2013-07-17 13:23:29 -07:00
Diva Canto f4317dc26d Putting the requests back in the queue while testing for count >0 is not the smartest move... 2013-07-17 12:57:34 -07:00
Diva Canto 0f5b616fb0 Didn't mean to commit this change in BlockingQueue.cs 2013-07-17 12:02:00 -07:00
Diva Canto e46459ef21 Cleared up much confusion in PollServiceRequestManager. Here's the history:
When Melanie added the web fetch inventory throttle to core, she made the long poll requests (EQs) effectively be handled on an active loop. All those requests, if they existed, were being constantly dequeued, checked for events (which most often they didn't have), and requeued again. This was an active loop thread on a 100ms cycle!
This fixes the issue. Now the inventory requests, if they aren't ready to be served, are placed directly back in the queue, but the long poll requests aren't placed there until there are events ready to be sent or timeout has been reached.
This puts the LongPollServiceWatcherThread back to 1sec cycle, as it was before.
2013-07-17 11:19:36 -07:00
Justin Clark-Casey (justincc) cbc3576ee2 minor: Add warning method doc about possibly inconsistent results returned from BlockingQueue.Contains(), Count() and GetQueueArray() 2013-07-16 23:14:53 +01:00
Justin Clark-Casey (justincc) 50b8ab60f2 Revert "Revert "MSDN documentation is unclear about whether exiting a lock() block will trigger a Monitor.Wait() to exit, so avoid some locks that don't actually affect the state of the internal queues in the BlockingQueue class.""
This reverts commit 21a09ad3ad.

After more analysis and discussion, it is apparant that the Count(), Contains() and GetQueueArray() cannot be made thread-safe anyway without external locking
And this change appears to have a positive impact on performance.
I still believe that Monitor.Exit() will not release any thread for Monitor.Wait(), as per http://msdn.microsoft.com/en-gb/library/vstudio/system.threading.monitor.exit%28v=vs.100%29.aspx
so this should in theory make no difference, though mono implementation issues could possibly be coming into play.
2013-07-16 23:00:07 +01:00
Justin Clark-Casey (justincc) 21a09ad3ad Revert "MSDN documentation is unclear about whether exiting a lock() block will trigger a Monitor.Wait() to exit, so avoid some locks that don't actually affect the state of the internal queues in the BlockingQueue class."
This reverts commit 42e2a0d66e

Reverting because unfortunately this introduces race conditions because Contains(), Count() and GetQueueArray() may now end up returning the wrong result if another thread performs a simultaneous update on m_queue.
Code such as PollServiceRequestManager.Stop() relies on the count being correct otherwise a request may be lost.
Also, though some of the internal queue methods do not affect state, they are not thread-safe and could return the wrong result generating the same problem
lock() generates Monitor.Enter() and Monitor.Exit() under the covers.  Monitor.Exit() does not cause Monitor.Wait() to exist, only Pulse() and PulseAll() will do this
Reverted with agreement.
2013-07-16 22:03:49 +01:00
dahlia 42e2a0d66e MSDN documentation is unclear about whether exiting a lock() block will trigger a Monitor.Wait() to exit, so avoid some locks that don't actually affect the state of the internal queues in the BlockingQueue class. 2013-07-16 01:12:56 -07:00
Justin Clark-Casey (justincc) eb14e5a175 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2013-07-15 23:28:02 +01:00
Justin Clark-Casey (justincc) 1b7b664c86 Add request received/handling stats for caps which are served by http poll handlers.
This adds explicit cap poll handler supporting to the Caps classes rather than relying on callers to do the complicated coding.
Other refactoring was required to get logic into the right places to support this.
2013-07-15 23:27:46 +01:00
Diva Canto 60325f81d8 This might address the following observed exception:
17:14:28 - [APPLICATION]:
APPLICATION EXCEPTION DETECTED: System.UnhandledExceptionEventArgs
Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object
  at System.Collections.Generic.Queue`1[OpenSim.Region.ClientStack.Linden.WebFetchInvDescModule+aPollRequest].Peek () [0x00011] in /root/install/mono-3.1.0/mono/mcs/class/System/System.Collections.Generic/Queue.cs:158
  at System.Collections.Generic.Queue`1[OpenSim.Region.ClientStack.Linden.WebFetchInvDescModule+aPollRequest].Dequeue () [0x00000] in /root/install/mono-3.1.0/mono/mcs/class/System/System.Collections.Generic/Queue.cs:140
  at OpenSim.Framework.DoubleQueue`1[OpenSim.Region.ClientStack.Linden.WebFetchInvDescModule+aPollRequest].Dequeue (TimeSpan wait, OpenSim.Region.ClientStack.Linden.aPollRequest& res) [0x0004e] in /home/avacon/opensim_2013-07-14/OpenSim/Framework/Util.cs:2297
2013-07-15 10:29:42 -07:00
Diva Canto c61ff917ef Authenticate ChildAgentUpdate too. 2013-07-14 09:21:28 -07:00
Robert Adams fa02f28dbf Add ToOSDMap() overrides to the Stat subclass CounterStat.
Add a GetStatsAsOSDMap method to StatsManager which allows the filtered
fetching of stats for eventual returning over the internets.
2013-07-12 14:04:14 -07:00
Justin Clark-Casey (justincc) 44e9849ed1 Fix regression where llHTTPRequests which did not get an OK response returned 499 and the exception message in the http_response event rather than the actual response code and body.
This was a regression since commit 831e4c3 (Thu Apr 4 00:36:15 2013)
This commit also adds a regression test for this case, though this currently only works with Mono
This aims to address http://opensimulator.org/mantis/view.php?id=6704
2013-07-11 23:02:30 +01:00
Diva Canto 1b265b213b Added show client-stats [first last] command to expose what viewers are requesting. 2013-07-10 16:09:45 -07:00
Justin Clark-Casey (justincc) 2025dd25f6 Add missing file BaseOutputStreamHandler.cs from recent commit e19defd 2013-07-08 23:50:40 +01:00
Justin Clark-Casey (justincc) eccec4f8f6 minor: remove now unused migration-hack bool from DAMap 2013-07-08 23:32:19 +01:00
Justin Clark-Casey (justincc) dc54581700 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2013-07-08 22:19:37 +01:00