XML RPC Http protocol violations..
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-21-2004 01:26
I am getting a significant number(20-30%) of http protocol violations when sending XML RPC commands to SL.
This closes the connection and I need to retransmit which no doubt causes yet more load on the XML RPC servers.
Anyone know anything about this?
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
Mark Linden
Funky Linden Monkey
Join date: 20 Nov 2002
Posts: 179
|
11-22-2004 08:52
Can you post more details? What kind of protocol violation are you seeing? Details logs, explanations of the XML-RPC library that you are using, etc would be helpful.
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
11-22-2004 19:58
Just in case its something simple: are you ensuring you call llRemoveDataSetRegion() on each sim boundary change? In the interval between changing sim and a completed call to this function, any xmlrpc calls to your object will fail. (= good reason to use email instead for attached objects).
Azelda
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-22-2004 20:36
No, I don't change SIMs.. objects are stationary as they accept XML commands. Here's the exception in c# System.Net.WebException: The underlying connection was closed: The server committed an HTTP protocol violation. at System.Net.HttpWebRequest.CheckFinalStatus() at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.HttpWebRequest.GetResponse() Here's a description of the software I wrote that's doing this: /8/36/27296/1.htmlI am currently working on a limited example program I will upload to this thread. On a typical build, I will do upwards of 200 xml rpc calls which are being threaded over 10 different threads talking to 10 different channels, though I was running into this with 1 and 2 threads as well. My concern is that throttling is happening on the LL side of things and if you are shutting down requests which are coming into fast. I can understand this, but perhaps you might want to let us know what's going on so we don't try to work around it and start crashing things with bleeding edge hacks. Cause I have done that a few times now and it's kinda like walking through a minefield..
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
Test program which creates HTTP protocol exceptions
11-23-2004 00:47
using System; using System.Collections; using System.IO; using System.Xml; using System.Net; using System.Text; using System.Reflection;
namespace TestXML { /// <summary> /// Summary description for Class1. /// </summary> class XMLTester { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { for(int i=0;i<5;i++) { testXML(); }
} static void testXML() { try { HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://xmlrpc.secondlife.com:80/cgi-bin/xmlrpc.cgi"); request.Method = "POST"; request.ContentType = "text/xml"; Stream stream = request.GetRequestStream(); StreamWriter sw=new StreamWriter(stream); XmlTextWriter xml = new XmlTextWriter(sw); sw.WriteLine("<?xml version=\"1.0\"?> "+ "<methodCall>"+ "<methodName>llRemoteData</methodName>"+ "<params>"+ "<param>"+ "<value>"+ "<struct>"+ "<member>"+ "<name>Channel</name>"+ "<value><string>119aab51-8635-13cc-b218-cfcad56f841a</string></value>"+ "</member>"+ "<member>"+ "<name>IntValue</name>"+ "<value><int>0</int></value>"+ "</member>"+ "<member>"+ "<name>StringValue</name>"+ "<value><string>test</string></value>"+ "</member>"+ "</struct>"+ "</value>"+ "</param>"+ "</params>"+ "</methodCall>"); xml.Flush(); xml.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader input = new StreamReader(response.GetResponseStream()); Console.WriteLine(input.ReadToEnd()); input.Close(); response.Close(); } catch(Exception E) { Console.WriteLine(E+":"+E.Message+":"+E.InnerException); }
} } }
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-23-2004 00:50
Here it is compile:
Note that you need to rename testXML.zip to testXML.exe .. don't bother trying to unzip it.
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
My output..
11-23-2004 00:51
<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name >Channel</name><value><string>119aab51-8635-13cc-b218-cfcad56f841a</string></val ue></member><member><name>StringValue</name><value><string>Got it</string></valu e></member><member><name>IntValue</name><value><int>0</int></value></member></st ruct></value></param></params></methodResponse> <?xml version="1.0"?><methodResponse><params><param><value><struct><member><name >Channel</name><value><string>119aab51-8635-13cc-b218-cfcad56f841a</string></val ue></member><member><name>StringValue</name><value><string>Got it</string></valu e></member><member><name>IntValue</name><value><int>0</int></value></member></st ruct></value></param></params></methodResponse> System.Net.WebException: The underlying connection was closed: The server commit ted an HTTP protocol violation. at System.Net.HttpWebRequest.CheckFinalStatus() at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.HttpWebRequest.GetResponse() at TestXML.XMLTester.testXML() in c:\development\builder\consoleapplication1\ consoleapplication1\class1.cs:line 66:The underlying connection was closed: The server committed an HTTP protocol violation.:
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
Test LSL script which receives XML request
11-23-2004 00:56
default { state_entry() { llOpenRemoteDataChannel(); llInstantMessage(llGetOwner(), "Opening channel.."); }
remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) { llInstantMessage(llGetOwner(), "Got remote data"); if (type==REMOTE_DATA_CHANNEL) { llInstantMessage(llGetOwner(), "channel: "+(string)channel); } if (type==REMOTE_DATA_REQUEST) { llInstantMessage(llGetOwner(), "msg: "+(string)sval); llRemoteDataReply(channel, message_id, "Got it", 0); } } touch_start(integer total_number) { llSay(0, "Touched."); } }
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
Azelda Garcia
Azelda Garcia
Join date: 3 Nov 2003
Posts: 819
|
11-23-2004 04:32
Blaze, you're stress-testing the SL infrastructure knowing full-well you'll probably break something. If I was Mark I'd feel justified in slapping you a bit!
Azelda
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-23-2004 05:10
Azelda, please reconsider your input as it's confusing the issue. Lindens, please note the above program does 5 RPC requests in a serial manner (not threaded). One would reasonably assume the servers could handle that. Also, please refer to the URL I posted above, which is here: /8/36/27296/1.html And a previous request for information and some answers (not by Lindens, unfortunately): /54/b8/27291/1.htmlIn order for the software I was referring to work at a reasonable rate it needs to make 100+ rpc xml calls over 10 threads. This is not 'stress testing'.
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
Tad Jensen
Script Junkie
Join date: 29 May 2004
Posts: 24
|
11-23-2004 07:53
my worry with talking to inworld scripts is multithreading...
what happens if you call the same script concurrently with XMLRPC? if the first request is currently in some other state and the next request comes in spawning the remote data event... is this an issue? or does LL thread the calls to the scripts from the outside world? or is the request somehow queued so that the XMLRPC calls don't step on each other.
i might have misunderstood your application as well... when you say 10 threads and 10 channels... are you saying for each channel you are sending 10 simultaneous calls? or are you matching thread to channel as in (1:1)
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-23-2004 08:22
SL queues all XML RPC requests and they are data events that enter into threads as events.
I have a c# Thread per XML channel per script. It's variable, I've run into the problem with 2 to 10 threads/scripts.
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
|
11-23-2004 09:39
This is not a problem with SL's XML-RPC implementation. I ran into this same exception being thrown when I first attempted XMLRPC comms with .NET. The problem turned out to be the fact that the XML-RPC library I was using was layered directly on top of HttpWebRequest like yours is. I would suggest downloading a good quality open-source xml-rpc library instead of trying to roll your own. The intracacies of .NET's native Http-related classes can be a bit dumbfounding, especially when you try to make them do stuff they weren't specifically made for. The best library I have found is called XmlRpcCS, which can be found here.
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-23-2004 09:51
Well, I discovered a workaround.
I set the keepalive to false. It seems to work fine now.
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|
Mark Linden
Funky Linden Monkey
Join date: 20 Nov 2002
Posts: 179
|
11-23-2004 10:03
blaze--
It sounds like you are doing neat stuff with the XML-RPC infrastructure; hurray!
Anyway, as to your problem; it doesn't look like we're actually commiting a protocol violation; the output that you've pasted in is the entire returned document. Apache will close the connection after it's done transmitting (we don't allow pipelining to the XML-RPC server). AFAIK, there's nothing wrong with that.
FYI: on our end, you're talking to Apache 1.3.mumble (don't remember off the top of my head), and it's running a CGI that handles the XML-RPC request.
I don't think that your app is using too many resources; however, I'd be interested to hear if that turns out to be not true.
|
blaze Spinnaker
1/2 Serious
Join date: 12 Aug 2004
Posts: 5,898
|
11-23-2004 10:10
The output is actually two successful attempts and the third hits the protocol violation.
I looked at the request headers being sent by dot net, and I noticed that the failed request was always missing a keep-alive header. I set the keepalive to false, and that seemed to fix the problem.
Why dot net sometimes sends keepalive and sometimes doesn't, I'm not sure. This may have something to do with me creating a new web request object each time or it may have something to do with quirky implementation of http protocol in your servers..
Either way, it's working now and I should probably sleep rather than test further..
_____________________
Taken from The last paragraph on pg. 16 of Cory Ondrejka's paper " Changing Realities: User Creation, Communication, and Innovation in Digital Worlds : " User-created content takes the idea of leveraging player opinions a step further by allowing them to effectively prototype new ideas and features. Developers can then measure which new concepts most improve the products and incorporate them into the game in future patches."
|