<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>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.<br>
<br>
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.<br>
<br>
- 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.<br>
<br>
- The timeout is left unspecified, hence the very long wait until it
fails. Setting it to 10 secs makes my problem go away.<br>
<br>
- 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: "</tt>Your application cannot mix synchronous and
asynchronous methods for a particular request. If you call the <b>GetRequestStream</b>
method, you must use the <a id="ctl00_rs1_mainContentContainer_ctl55"
 onclick="javascript:Track('ctl00_rs1_mainContentContainer_cpe299294_c|ctl00_rs1_mainContentContainer_ctl55',this);"
 href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.getresponse%28VS.80%29.aspx">GetResponse</a>
method to retrieve the response." (they consistently say the converse
for the asynchronous methods)<br>
<tt>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. <br>
But my point is that there is a chance that the receiving of inventory
is synchronous because the request starts in synchronous mode...<br>
<br>
- Another question: why is RequestInventoryForUser a POST operation?<br>
<br>
Crista<br>
<br>
<br>
<br>
<br>
</tt>
</body>
</html>