• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-3331
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Won't Finish
Priority: Normal Normal
Assignee: kelly linden
Reporter: Hewee Zetkin
Votes: 17
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

Stable URLs for LSL_http_server

Created: 27/Oct/08 10:02 AM   Updated: 30/Oct/08 03:51 PM
Return to search
Component/s: Scripts
Affects Version/s: None
Fix Version/s: None

Issue Links:
Relates


 Description  « Hide
The HTTP server functionality described in http://wiki.secondlife.com/wiki/LSL_http_server makes it very difficult to host a stable server object in SL. This is because the script must allocate a new temporary URL not only for new object instances, but also if the script is reset, if the sim is restarted, or if the object changes regions.

An obvious solution to this problem would be to use the key of the prim to form a URL. This should work because there is already a need to lookup an object by key on the grid (otherwise even in-world object-to-object e-mail wouldn't work). Speed for HTTP functionality might be an issue, but if LL is serious about implementing this kind of feature, some form of efficient caching could be implemented. This also shouldn't be any more onerous than registering a temporary URL as is currently done for beta.

However, then the question is, "Which script would service any given request if multiple have http_request handlers?" An event-based solution is much more desirable than some kind of polling, not to mention necessary for both performance and to avoid HTTP timeouts, so a llGetNextEmail() type solution is out.

I suggest using a URL that includes both the key of the prim and the URL-encoded name of the script (since a script name is unique within the inventory of its containing prim). Whether the script would still have to request the URL or whether it would be assigned automatically if the script has a http_request handler in the current event is a separate issue and could be addressed elsewhere. This would allow a script to determine its own URL using a simple pattern, llGetKey(), and 'llEscapeURL(llGetScriptName())'.

Example URL pattern: http://lslwww.secondlife.com/<primKey>/<urlEncodedScriptName>
Example URL: http://lslwww.secondlife.com/12341234-1234-1234-1234-123412341234/My%20Http%20Script

IMPORTANT IMPLEMENTATION NOTE: There is nothing about this solution that would need to break existing beta scripts utilizing the functionality, except for the corner case where a script might request multiple URLs (which can be switched to using different path parts or query parameters to handle the same requirement). If the server logic always returns the calculated URL when a URL is requested, any scripts utilizing a single URL can continue to function as-is.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Hewee Zetkin made changes - 27/Oct/08 10:05 AM
Field Original Value New Value
Link This issue duplicates SVC-3238 [ SVC-3238 ]
Hewee Zetkin made changes - 27/Oct/08 10:05 AM
Link This issue duplicates SVC-3238 [ SVC-3238 ]
Hewee Zetkin made changes - 27/Oct/08 10:06 AM
Link This issue Relates to SVC-3238 [ SVC-3238 ]
Hewee Zetkin made changes - 27/Oct/08 10:08 AM
Link This issue Relates to SVC-1086 [ SVC-1086 ]
Hewee Zetkin made changes - 27/Oct/08 10:13 AM
Description The HTTP server functionality described in http://wiki.secondlife.com/wiki/LSL_http_server makes it very difficult to host a stable server object in SL. This is because the script must allocate a new temporary URL not only for new object instances, but also if the script is reset, if the sim is restarted, or if the object changes regions.

An obvious solution to this problem would be to use the key of the prim to form a URL. This should work because there is already a need to lookup an object by key on the grid (otherwise even in-world object-to-object e-mail wouldn't work). Speed for HTTP functionality might be an issue, but if LL is serious about implementing this kind of feature, some form of efficient caching could be implemented.

However, then the question is, "Which script would service any given request if multiple have http_request handlers?" An event-based solution is much more desirable than some kind of polling, not to mention necessary for both performance and to avoid HTTP timeouts, so a llGetNextEmail() type solution is out.

I suggest using a URL that includes both the key of the prim and the URL-encoded name of the script (since a script name is unique within the inventory of its containing prim). Whether the script would still have to request the URL or whether it would be assigned automatically if the script has a http_request handler in the current event is a separate issue and could be addressed elsewhere. This would allow a script to determine its own URL using a simple pattern, llGetKey(), and 'llEscapeURL(llGetScriptName())'.

Example URL pattern: http://lslwww.secondlife.com/&lt;primKey&gt;/&lt;urlEncodedScriptName>
Example URL: http://lslwww.secondlife.com/12341234-1234-1234-1234-123412341234/My%20Http%20Script

IMPORTANT IMPLEMENTATION NOTE: There is nothing about this solution that would need to break existing beta scripts utilizing the functionality, except for the corner case where a script might request multiple URLs (which can be switched to using different path parts or query parameters to handle the same requirement). If the server logic always returns the calculated URL when a URL is requested, any scripts utilizing a single URL can continue to function as-is.
The HTTP server functionality described in http://wiki.secondlife.com/wiki/LSL_http_server makes it very difficult to host a stable server object in SL. This is because the script must allocate a new temporary URL not only for new object instances, but also if the script is reset, if the sim is restarted, or if the object changes regions.

An obvious solution to this problem would be to use the key of the prim to form a URL. This should work because there is already a need to lookup an object by key on the grid (otherwise even in-world object-to-object e-mail wouldn't work). Speed for HTTP functionality might be an issue, but if LL is serious about implementing this kind of feature, some form of efficient caching could be implemented. This also shouldn't be any more onerous than registering a temporary URL as is currently done for beta.

However, then the question is, "Which script would service any given request if multiple have http_request handlers?" An event-based solution is much more desirable than some kind of polling, not to mention necessary for both performance and to avoid HTTP timeouts, so a llGetNextEmail() type solution is out.

I suggest using a URL that includes both the key of the prim and the URL-encoded name of the script (since a script name is unique within the inventory of its containing prim). Whether the script would still have to request the URL or whether it would be assigned automatically if the script has a http_request handler in the current event is a separate issue and could be addressed elsewhere. This would allow a script to determine its own URL using a simple pattern, llGetKey(), and 'llEscapeURL(llGetScriptName())'.

Example URL pattern: http://lslwww.secondlife.com/&lt;primKey&gt;/&lt;urlEncodedScriptName>
Example URL: http://lslwww.secondlife.com/12341234-1234-1234-1234-123412341234/My%20Http%20Script

IMPORTANT IMPLEMENTATION NOTE: There is nothing about this solution that would need to break existing beta scripts utilizing the functionality, except for the corner case where a script might request multiple URLs (which can be switched to using different path parts or query parameters to handle the same requirement). If the server logic always returns the calculated URL when a URL is requested, any scripts utilizing a single URL can continue to function as-is.
kelly linden added a comment - 28/Oct/08 09:57 AM
I completely understand how desirable persistent URLs are. Trust me, I have gone through many debates on this issue. The decision made was not arbitrary or quick. The design went through various iterations and reviews for the better part of a year to get to where it is. I also would really like persistent URLs. I wanted to say all this before I started outlining why this proposed solution does not work.
  • lsl email is not scalable. We have had HUGE problems with it in the past and barely have it under control today. What "isn't scalable" means is that it requires separate servers to track the locations of objects and that the amount of work needed (messages to route, objects to track) doesn't scale at the same rate as we normally bring hardware online. It grows much faster. So believing something is workable because we do something similar for email is a bad way to start. XML-RPC is about 10x worse. The driving force behind this feature is for it to be more scalable than either of those solutions.
  • Tying the urls to object IDs only removes 'script reset' from the list of ways an url could be lost (see next point), and the cost is multiple urls per object and per script. We felt these two features (separate urls for each script and multiple per script) were more than worth the single reset case.
  • The reason it only gets you that is you jumped a huge step, the main point of email's problems, between "use the object ID" and how your urls look. You lost all the server and port information. The currently implemented method has urls that look like:
    http://sim123.agni.lindenlab.com:12031/cap/<uuid>
    That server and port change whenever the region goes offline/restarts or the object changes what region it is on. And tracking that for every object that has an url is not feasible, but would be required of this proposed solution.
  • You may notice we have covered every 'url lost' case so far except one - object rez. Even in your proposed solution the url would change on object rez since the ID of the object changes on object rez.

So, what would it take to have persistent urls? It would take new hardware which the current implementation doesn't need. It would take a registration call to request a persistent url. It may need to have a small L$ cost for that registration to offset the additional overhead. These new servers would need to get messages to update their forwarding information every time the script was reset, the object changed regions, the object was rezed or the region restarted. In other words these servers would have to do everything that an external forwarding service has to do now. It is possible we could implement such a service in the future if needed, however we fully expect there to be 3rd party solutions by the time this gets out of beta if not much sooner.

Yes, I want persistent urls. The current implementation does not preclude persistent urls. They are possible as a 3rd party service and it is possible for them to be added later with no lost or duplicated work or effort. The current implementation is the simplest solution that works and creates a potential new service for 3rd parties to offer.


kelly linden made changes - 28/Oct/08 09:58 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Finish [ 2 ]
Assignee kelly linden [ kelly linden ]
Hewee Zetkin added a comment - 28/Oct/08 11:13 AM - edited
Ah. Yes, I see how the routing information was lost by the suggestion, and how it is probably necessary for a scalable solution without significant additional investment on LL's part. I still hope it is looked into in the future. From what I have seen, LSL scripters (both as individuals and as a community) don't much like to rely on external services (for reliability, simplicity, and security), which is one of the reasons this functionality would be a great improvement if it DID provide stable URLs.

Thank you Kelly for the thoughtful and detailed reply, and thank you everyone who voted. Keep up the great work, and see you in the sandboxes!


Periapse Linden made changes - 30/Oct/08 03:50 PM
Link This issue is related to by SVC-3238 [ SVC-3238 ]
Periapse Linden made changes - 30/Oct/08 03:51 PM
Link This issue Relates to SVC-3238 [ SVC-3238 ]
Sue Linden made changes - 13/Nov/08 12:11 PM
Workflow jira-2007-12-22a [ 61027 ] jira-2008-11-14 [ 82756 ]
Sue Linden made changes - 13/Nov/08 04:49 PM
Workflow jira-2008-11-14 [ 82756 ] jira-2008-11-14a [ 93091 ]