[Opensim-dev] partially synchronous inventory lookup
Cristina Videira Lopes
lopes at ics.uci.edu
Sat Jan 31 04:06:46 UTC 2009
Thanks to being away from my usual development environment, I was able
to produce a situation where RequestInventoryForUser always fails for HG
TPs, because of an erroneous IP address in some table. Not just
inventory lookup fails, but the TP itself sort of fails.
This made me look closer to RestSessionService and
RestObjectPosterResponse (I'm not sure why we have these two, they seem
very similar, but that's not the point). I found out why the TPs fail,
and in the process I saw lots of things that got me confused. I thought
I'd share these observations here, I'm not sure I'll be in sync with the
relevant people on the IRC.
- The TPs fail because the IP address for inventory server is invalid,
and it turns out that the request for inventory is *partially*
synchronous. So, the receiving region tries to get inventory and it gets
stuck for a long time, which makes it miss the departing region's
timeout of 20 seconds for confirmation that the other one got the agent.
So the departing region thinks the TP failed.
- The timeout is left unspecified, hence the very long wait until it
fails. Setting it to 10 secs makes my problem go away.
- This *partially* synchronous business comes from this: the method
starts by doing a synchronous GetRequestStream and ends by doing an
asynchronous BeginGetResponse. In looking at the .Net API documentation
I see this note: "Your application cannot mix synchronous and
asynchronous methods for a particular request. If you call the
*GetRequestStream* method, you must use the GetResponse
<http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.getresponse%28VS.80%29.aspx>
method to retrieve the response." (they consistently say the converse
for the asynchronous methods)
They don't say what happens if we don't follow that rule, but the rule
is quite assertive. Their examples are quite confusing, though,
especially the example for the asynchronous BeginGetRequestStream.
But my point is that there is a chance that the receiving of inventory
is synchronous because the request starts in synchronous mode...
- Another question: why is RequestInventoryForUser a POST operation?
Crista
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20090130/aedf536b/attachment-0001.html>
More information about the Opensim-dev
mailing list