Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Checking if an scripted object is reachable - Fastest way

Tadao Nordenskiold
Registered User
Join date: 9 May 2009
Posts: 37
12-27-2009 09:14
I am trying to experiment with an server object that should send some inventory item(s) to customers. The thing is that I want it to be as fast and reliable as possible.

Correct me if I am wrong here, but isn't the case that if a sim goes down (for restart or is simply unreachable for a moment) the emails to an object won't get into a queue?
If it indeed is queued untill the sim gets up again, the procedure isn't nessesary unless the object has been (for any reason) sent back to me, beeing deleted or have had it's UUID changed.

I want to make sure that a server object can be contacted at any time, and to make sure of that I am thinking of placing 2 (or more) objects in world and have them register them self against my sql database with their keys and locations.

At first I was thinking I could have the vendor check against the database, and send an email to the first server object it finds in the database and ask for a reply.
If the server object is there, it replies with something like "UUID is alive".
If the vendor gets the reply, it then again sends an email telling the server object to deliver the inventory item(s).
If no response is given, the procedure restarts with the next server object.

But even if the first server object is replying, it will take at least 60 seconds before the customer gets the inventory item(s). And if the first one does not reply, it could take two or even three minutes (depending on how many objects is failing to reply) before anything happens.

Even just one minute would make most customers worried about the delivery.
Is there another, faster way of checking wether an object is reachable or not?
Or is it all totaly unnessesary?
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
12-27-2009 20:39
In SL, most people get used to slow / late deliveries. Most places will tell you to wait up to 5 minutes for a delivery. Some places will tell you to wait even longer, and if you haven't received anything in 24 hours, THEN contact the store owner about it.

As for reliability, there is no such thing in SL. SL is not transactional at its core; i.e., there is no way to verify even that the asset system actually gave the inventory to the recipient. All you can do is hope and pray, and deal with those few people for whom it fails on a case-by-case basis.

As for the client-server issue, build in transactional reliability in your protocols. On the client side, send a request, keeping a record of that request, and resending it periodically until you get a notice back that it has been fulfilled. On the server side, keep track of requests and keep a queue of recently-fulfilled ones which you should continue to respond with "completed" notices every time you get a duplicate request.

That solution isn't 100%, but it is likely at least a "3 nines" up to a "5 nines" solution, if you implement it well.

In addition, you may consider backending your inventory system out-world on a third-party webserver, so the nuisance of SL region crashes and other nonsense will have less of an impact.

SL is all about "best effort", not 100% reliability. You can't even get that in the Real World(tm).
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
12-28-2009 03:04
You can also have multiple delivery systems in different sims, and when a transaction is made, if one sim is down, likely the other is not. It takes a bit of coding, but you can work out a system where multiple delivery boxes are notified, and have a pecking order.

For example, say you have 3 delivery boxes in 3 different sims. All 3 boxes get notified to deliver. Box 2 waits 5 minutes before delivery and box 3 waits 10. If all 3 boxes are up and running, Box 1 will make the delivery and then notify box 2 and 3 that the delivery has been made (hence boxes 2 and 3 will not attempt delivery). If box 1 is down, after the 5 minute timer triggers in box 2, it will then deliver the item and notify box 3, etc.

This is sort of how XStreet works as you can solidify your delivery system by having multiple boxes rezzed in different sims as a backup.